diff options
| author | Chris Lu <chris.lu@gmail.com> | 2019-02-15 00:09:19 -0800 |
|---|---|---|
| committer | Chris Lu <chris.lu@gmail.com> | 2019-02-15 00:09:19 -0800 |
| commit | 74fb237727267aa482ee07851f454ca03fbd1fdf (patch) | |
| tree | ca1a25621f932c46618da103f1cb6d7b95801168 /weed/operation/upload_content.go | |
| parent | a3b0e39b06dcc284ff255d9c2a3c1f55c05ad19c (diff) | |
| download | seaweedfs-74fb237727267aa482ee07851f454ca03fbd1fdf.tar.xz seaweedfs-74fb237727267aa482ee07851f454ca03fbd1fdf.zip | |
benchmark can work in secure mode
Diffstat (limited to 'weed/operation/upload_content.go')
| -rw-r--r-- | weed/operation/upload_content.go | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/weed/operation/upload_content.go b/weed/operation/upload_content.go index 030bf5889..be7b8e69c 100644 --- a/weed/operation/upload_content.go +++ b/weed/operation/upload_content.go @@ -58,9 +58,6 @@ func upload_content(uploadUrl string, fillBufferFunction func(w io.Writer) error if isGzipped { h.Set("Content-Encoding", "gzip") } - if jwt != "" { - h.Set("Authorization", "BEARER "+string(jwt)) - } file_writer, cp_err := body_writer.CreatePart(h) if cp_err != nil { @@ -86,6 +83,9 @@ func upload_content(uploadUrl string, fillBufferFunction func(w io.Writer) error for k, v := range pairMap { req.Header.Set(k, v) } + if jwt != "" { + req.Header.Set("Authorization", "BEARER "+string(jwt)) + } resp, post_err := client.Do(req) if post_err != nil { glog.V(0).Infoln("failing to upload to", uploadUrl, post_err.Error()) |
