mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2024-01-19 02:48:24 +00:00
s3 header add user agent
This commit is contained in:
parent
608dc11a28
commit
d04cdcf40d
|
@ -2,6 +2,8 @@ package s3_backend
|
|||
|
||||
import (
|
||||
"fmt"
|
||||
"github.com/aws/aws-sdk-go/aws/request"
|
||||
"github.com/chrislusf/seaweedfs/weed/util"
|
||||
"sync"
|
||||
|
||||
"github.com/aws/aws-sdk-go/aws"
|
||||
|
@ -47,6 +49,9 @@ func createSession(awsAccessKeyId, awsSecretAccessKey, region, endpoint string)
|
|||
if err != nil {
|
||||
return nil, fmt.Errorf("create aws session in region %s: %v", region, err)
|
||||
}
|
||||
sess.Handlers.Build.PushBack(func(r *request.Request) {
|
||||
r.HTTPRequest.Header.Set("User-Agent", "SeaweedFS/"+util.VERSION_NUMBER)
|
||||
})
|
||||
|
||||
t := s3.New(sess)
|
||||
|
||||
|
|
Loading…
Reference in a new issue