We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 955e3de commit 01135dbCopy full SHA for 01135db
src/invidious/routes/video_playback.cr
@@ -14,12 +14,18 @@ module Invidious::Routes::VideoPlayback
14
end
15
16
if query_params["host"]? && !query_params["host"].empty?
17
- host = "https://#{query_params["host"]}"
+ host = query_params["host"]
18
query_params.delete("host")
19
else
20
- host = "https://r#{fvip}---#{mns.pop}.googlevideo.com"
+ host = "r#{fvip}---#{mns.pop}.googlevideo.com"
21
22
23
+ # Sanity check, to avoid being used as an open proxy
24
+ if !host.matches?(/[\w-]+.googlevideo.com/)
25
+ return error_template(400, "Invalid \"host\" parameter.")
26
+ end
27
+
28
+ host = "https://#{host}"
29
url = "/videoplayback?#{query_params}"
30
31
headers = HTTP::Headers.new
0 commit comments