mirror of
https://gitea.invidious.io/iv-org/invidious-copy-2022-03-16.git
synced 2024-08-15 00:53:18 +00:00
Strip invalid characters from referer URLs
This commit is contained in:
parent
70cbe91776
commit
4011a113cc
1 changed files with 1 additions and 1 deletions
|
@ -316,7 +316,7 @@ def get_referer(env, fallback = "/", unroll = true)
|
|||
end
|
||||
|
||||
referer = referer.full_path
|
||||
referer = "/" + referer.lstrip("/\\")
|
||||
referer = "/" + referer.gsub(/[^\/?@&%=\-_.0-9a-zA-Z]/, "").lstrip("/\\")
|
||||
|
||||
if referer == env.request.path
|
||||
referer = fallback
|
||||
|
|
Loading…
Reference in a new issue