fix: query needs to be manually built and re-encoded

This commit is contained in:
Derrick Hammer 2024-01-20 08:22:51 -05:00
parent 07c36109d8
commit 75e7ba00cd
Signed by: pcfreak30
GPG Key ID: C997C339BE476FF2
1 changed files with 4 additions and 1 deletions

View File

@ -122,7 +122,10 @@ func (w *tusJwtResponseWriter) WriteHeader(statusCode int) {
if authToken != "" && location != "" {
parsedUrl, _ := url.Parse(location)
parsedUrl.Query().Set("auth_token", authToken)
query := parsedUrl.Query()
query.Set("auth_token", authToken)
parsedUrl.RawQuery = query.Encode()
w.Header().Set("Location", parsedUrl.String())
}