mirror of
https://gitea.invidious.io/iv-org/invidious.git
synced 2024-08-15 00:53:41 +00:00
Merge 04cacfee5e
into e319c35f09
This commit is contained in:
commit
deae944e7d
1 changed files with 3 additions and 2 deletions
|
@ -21,7 +21,7 @@ module Invidious::Routes::VideoPlayback
|
||||||
end
|
end
|
||||||
|
|
||||||
# Sanity check, to avoid being used as an open proxy
|
# Sanity check, to avoid being used as an open proxy
|
||||||
if !host.matches?(/[\w-]+.googlevideo.com/)
|
if !host.matches?(/[\w-]+\.(?:googlevideo|c\.youtube)\.com/)
|
||||||
return error_template(400, "Invalid \"host\" parameter.")
|
return error_template(400, "Invalid \"host\" parameter.")
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -37,7 +37,8 @@ module Invidious::Routes::VideoPlayback
|
||||||
|
|
||||||
# See: https://github.com/iv-org/invidious/issues/3302
|
# See: https://github.com/iv-org/invidious/issues/3302
|
||||||
range_header = env.request.headers["Range"]?
|
range_header = env.request.headers["Range"]?
|
||||||
if range_header.nil?
|
sq = query_params["sq"]?
|
||||||
|
if range_header.nil? && sq.nil?
|
||||||
range_for_head = query_params["range"]? || "0-640"
|
range_for_head = query_params["range"]? || "0-640"
|
||||||
headers["Range"] = "bytes=#{range_for_head}"
|
headers["Range"] = "bytes=#{range_for_head}"
|
||||||
end
|
end
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue