Skip to content

Commit

Permalink
Merge pull request #269 from tencentyun/feature_jojoliang_d92dbd26
Browse files Browse the repository at this point in the history
x-cos-symlink-target内部做urlencode
  • Loading branch information
agin719 authored Jul 11, 2024
2 parents 3e334a4 + e019c95 commit a8f14e5
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion object.go
Original file line number Diff line number Diff line change
Expand Up @@ -1910,11 +1910,15 @@ func (s *ObjectService) PutSymlink(ctx context.Context, name string, opt *Object
if opt == nil || opt.SymlinkTarget == "" {
return nil, errors.New("SymlinkTarget is empty")
}
copt := &ObjectPutSymlinkOptions{
SymlinkTarget: encodeURIComponent(opt.SymlinkTarget),
XOptionHeader: opt.XOptionHeader,
}
sendOpt := &sendOptions{
baseURL: s.client.BaseURL.BucketURL,
uri: "/" + encodeURIComponent(name) + "?symlink",
method: http.MethodPut,
optHeader: opt,
optHeader: copt,
}
resp, err := s.client.doRetry(ctx, sendOpt)
return resp, err
Expand Down

0 comments on commit a8f14e5

Please sign in to comment.