diff options
| author | Samantaz Fox <coding@samantaz.fr> | 2024-07-21 14:13:54 +0200 |
|---|---|---|
| committer | Samantaz Fox <coding@samantaz.fr> | 2024-07-21 17:23:53 +0200 |
| commit | 1ff0775f4b9084806558b2351c16fba057c17c9a (patch) | |
| tree | 973f45eeda3680c42be1f3153991ff461fd83635 /src | |
| parent | e62d4db752f2c11ff5e2c6bc573aae8047da8783 (diff) | |
| parent | b90cf286fc947ed265031907bdb786986a399c41 (diff) | |
| download | invidious-1ff0775f4b9084806558b2351c16fba057c17c9a.tar.gz invidious-1ff0775f4b9084806558b2351c16fba057c17c9a.tar.bz2 invidious-1ff0775f4b9084806558b2351c16fba057c17c9a.zip | |
API: Fix duplicated query parameters in proxied video URLs (#4587)
This pull request fixes that bug that was causing the query parameters to get
doubled in the streaming URLs when '?local=true' is passed to the
'/api/v1/videos/{id}' API endpoint.
Before: host/path?parameters?parameters
After: host/path?parameters
No associated open issue
Diffstat (limited to 'src')
| -rw-r--r-- | src/invidious/http_server/utils.cr | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/invidious/http_server/utils.cr b/src/invidious/http_server/utils.cr index 222dfc4a..623a9177 100644 --- a/src/invidious/http_server/utils.cr +++ b/src/invidious/http_server/utils.cr @@ -11,11 +11,12 @@ module Invidious::HttpServer params = url.query_params params["host"] = url.host.not_nil! # Should never be nil, in theory params["region"] = region if !region.nil? + url.query_params = params if absolute - return "#{HOST_URL}#{url.request_target}?#{params}" + return "#{HOST_URL}#{url.request_target}" else - return "#{url.request_target}?#{params}" + return url.request_target end end |
