diff --git a/CHANGELOG.md b/CHANGELOG.md index bdb54c00..3f2137f0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), ### Fixed * Return a 404 instead of 500 when clients access media which is frozen. +* Ensure the request parameters are correctly set for authenticated media client requests. ## [1.3.7] - July 30, 2024 diff --git a/api/v1/download.go b/api/v1/download.go index 0e2e8e22..9f4dfaff 100644 --- a/api/v1/download.go +++ b/api/v1/download.go @@ -15,8 +15,10 @@ import ( ) func ClientDownloadMedia(r *http.Request, rctx rcontext.RequestContext, user _apimeta.UserInfo) interface{} { - r.URL.Query().Set("allow_remote", "true") - r.URL.Query().Set("allow_redirect", "true") + query := r.URL.Query() + query.Set("allow_remote", "true") + query.Set("allow_redirect", "true") + r.URL.RawQuery = query.Encode() return r0.DownloadMedia(r, rctx, _apimeta.AuthContext{User: user}) } diff --git a/api/v1/thumbnail.go b/api/v1/thumbnail.go index 6d00d1a9..33b5d23d 100644 --- a/api/v1/thumbnail.go +++ b/api/v1/thumbnail.go @@ -15,8 +15,10 @@ import ( ) func ClientThumbnailMedia(r *http.Request, rctx rcontext.RequestContext, user _apimeta.UserInfo) interface{} { - r.URL.Query().Set("allow_remote", "true") - r.URL.Query().Set("allow_redirect", "true") + query := r.URL.Query() + query.Set("allow_remote", "true") + query.Set("allow_redirect", "true") + r.URL.RawQuery = query.Encode() return r0.ThumbnailMedia(r, rctx, _apimeta.AuthContext{User: user}) }