Skip to content

Commit 0e76273

Browse files
committed
proxy for put
1 parent de08aa9 commit 0e76273

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

upyun/rest.go

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -248,12 +248,17 @@ func (up *UpYun) put(config *PutObjectConfig) error {
248248
config.Headers["X-Upyun-Append"] = "true"
249249
}
250250
*/
251+
252+
reader := config.Reader
253+
if config.ProxyReader != nil {
254+
reader = config.ProxyReader(0, config.Reader)
255+
}
251256
_, err := up.doRESTRequest(&restReqConfig{
252257
method: "PUT",
253258
uri: config.Path,
254259
headers: config.Headers,
255260
closeBody: true,
256-
httpBody: config.Reader,
261+
httpBody: reader,
257262
useMD5: config.UseMD5,
258263
})
259264
if err != nil {

0 commit comments

Comments
 (0)