BUGFIX: ensure Authorization header is only added once

This commit is contained in:
Sebastian Kurfuerst
2021-12-31 22:06:18 +01:00
parent 1cd3b6b4e1
commit c35660175d
2 changed files with 9 additions and 6 deletions

View File

@@ -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)