Skip to content

Commit

Permalink
proxy for put
Browse files Browse the repository at this point in the history
  • Loading branch information
huangnauh committed Oct 31, 2024
1 parent de08aa9 commit 0e76273
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion upyun/rest.go
Original file line number Diff line number Diff line change
Expand Up @@ -248,12 +248,17 @@ func (up *UpYun) put(config *PutObjectConfig) error {
config.Headers["X-Upyun-Append"] = "true"
}
*/

reader := config.Reader
if config.ProxyReader != nil {
reader = config.ProxyReader(0, config.Reader)
}
_, err := up.doRESTRequest(&restReqConfig{
method: "PUT",
uri: config.Path,
headers: config.Headers,
closeBody: true,
httpBody: config.Reader,
httpBody: reader,
useMD5: config.UseMD5,
})
if err != nil {
Expand Down

0 comments on commit 0e76273

Please sign in to comment.