mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2025-09-19 23:17:57 +08:00
BUGFIX: ensure Authorization header is only added once
This commit is contained in:
@@ -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)
|
||||
|
Reference in New Issue
Block a user