Skip to content

Commit

Permalink
Ensure client requests have correct params set (#605)
Browse files Browse the repository at this point in the history
  • Loading branch information
turt2live authored Aug 9, 2024
1 parent 1457834 commit eb774d8
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 4 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
6 changes: 4 additions & 2 deletions api/v1/download.go
Original file line number Diff line number Diff line change
Expand Up @@ -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})
}

Expand Down
6 changes: 4 additions & 2 deletions api/v1/thumbnail.go
Original file line number Diff line number Diff line change
Expand Up @@ -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})
}

Expand Down

0 comments on commit eb774d8

Please sign in to comment.