diff options
| author | Samantaz Fox <coding@samantaz.fr> | 2024-11-10 17:30:42 +0100 |
|---|---|---|
| committer | Samantaz Fox <coding@samantaz.fr> | 2024-11-10 18:15:24 +0100 |
| commit | 3ac8978e96069e58a02e91fc29bf52b8fc651d5c (patch) | |
| tree | 2858982368b4665f6b4d603cdd9f37369c03c896 /src | |
| parent | e7a93fcc18d465dee7f77e01f3d9f9a2b1206092 (diff) | |
| download | invidious-3ac8978e96069e58a02e91fc29bf52b8fc651d5c.tar.gz invidious-3ac8978e96069e58a02e91fc29bf52b8fc651d5c.tar.bz2 invidious-3ac8978e96069e58a02e91fc29bf52b8fc651d5c.zip | |
VideoProxy: Handle 302 redirects in chunked section
Diffstat (limited to 'src')
| -rw-r--r-- | src/invidious/routes/video_playback.cr | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/invidious/routes/video_playback.cr b/src/invidious/routes/video_playback.cr index 26852d06..a8f9f665 100644 --- a/src/invidious/routes/video_playback.cr +++ b/src/invidious/routes/video_playback.cr @@ -164,10 +164,13 @@ module Invidious::Routes::VideoPlayback env.response.headers["Access-Control-Allow-Origin"] = "*" if location = resp.headers["Location"]? - location = URI.parse(location) - location = "#{location.request_target}&host=#{location.host}#{region ? "®ion=#{region}" : ""}" + url = Invidious::HttpServer::Utils.proxy_video_url(location, region: region) - env.redirect location + if title = query_params["title"]? + url = "#{url}&title=#{URI.encode_www_form(title)}" + end + + env.redirect url break end |
