aboutsummaryrefslogtreecommitdiff
path: root/weed/util/http_util.go
diff options
context:
space:
mode:
authorSebastian Kurfuerst <sebastian.kurfuerst@sandstorm.de>2021-12-31 22:06:18 +0100
committerSebastian Kurfuerst <sebastian.kurfuerst@sandstorm.de>2021-12-31 22:06:18 +0100
commitc35660175d0ffc88a1e0097ec90bd7e000339d14 (patch)
treef91d45a6f55bcb10c9b8a8d85669bca8f2694e23 /weed/util/http_util.go
parent1cd3b6b4e12e4d25e66d1c6203ba1c58081b873b (diff)
downloadseaweedfs-c35660175d0ffc88a1e0097ec90bd7e000339d14.tar.xz
seaweedfs-c35660175d0ffc88a1e0097ec90bd7e000339d14.zip
BUGFIX: ensure Authorization header is only added once
Diffstat (limited to 'weed/util/http_util.go')
-rw-r--r--weed/util/http_util.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/weed/util/http_util.go b/weed/util/http_util.go
index 5c814a6d3..e658ab66b 100644
--- a/weed/util/http_util.go
+++ b/weed/util/http_util.go
@@ -186,7 +186,7 @@ func DownloadFile(fileUrl string, jwt string) (filename string, header http.Head
}
if len(jwt) > 0 {
- req.Header.Add("Authorization", "BEARER "+jwt)
+ req.Header.Set("Authorization", "BEARER "+jwt)
}
response, err := client.Do(req)
@@ -380,7 +380,7 @@ func ReadUrlAsReaderCloser(fileUrl string, jwt string, rangeHeader string) (io.R
}
if len(jwt) > 0 {
- req.Header.Add("Authorization", "BEARER "+jwt)
+ req.Header.Set("Authorization", "BEARER "+jwt)
}
r, err := client.Do(req)