mirror of
https://github.com/iv-org/invidious.git
synced 2024-11-09 15:02:14 +05:30
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
This commit is contained in:
commit
1ff0775f4b
@ -11,11 +11,12 @@ module Invidious::HttpServer
|
|||||||
params = url.query_params
|
params = url.query_params
|
||||||
params["host"] = url.host.not_nil! # Should never be nil, in theory
|
params["host"] = url.host.not_nil! # Should never be nil, in theory
|
||||||
params["region"] = region if !region.nil?
|
params["region"] = region if !region.nil?
|
||||||
|
url.query_params = params
|
||||||
|
|
||||||
if absolute
|
if absolute
|
||||||
return "#{HOST_URL}#{url.request_target}?#{params}"
|
return "#{HOST_URL}#{url.request_target}"
|
||||||
else
|
else
|
||||||
return "#{url.request_target}?#{params}"
|
return url.request_target
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user