Skip to content

Commit

Permalink
fix: error upload for the chinese object name
Browse files Browse the repository at this point in the history
  • Loading branch information
saltbo committed Jul 15, 2021
1 parent 3cee3b7 commit ee8ec28
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions internal/pkg/provider/provider_uss.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,11 +64,11 @@ func (p *USSProvider) SignedPutURL(key, filetype string, filesize int64, public

//老版签名不能设置有效期,固定为30min
headers = make(http.Header)
uri := fmt.Sprintf("/%s/%s", p.client.Bucket, key)
date := time.Now().UTC().Format(http.TimeFormat)
uri := fmt.Sprintf("/%s/%s", p.client.Bucket, urlEncode(key))
headers.Set("X-Date", date)
headers.Set("Authorization", p.buildOldSign("PUT", uri, date, fmt.Sprint(filesize)))
return fmt.Sprintf("http://v0.api.upyun.com/%s/%s", p.client.Bucket, key), headers, err
return fmt.Sprintf("http://v0.api.upyun.com%s", uri), headers, err
}

func (p *USSProvider) SignedGetURL(key, filename string) (url string, err error) {
Expand Down

0 comments on commit ee8ec28

Please sign in to comment.