mirror of
https://gitea.invidious.io/iv-org/invidious-copy-2022-03-16.git
synced 2024-08-15 00:53:18 +00:00
Fix video ID redirect
This commit is contained in:
parent
01e5bec246
commit
2e69774b1f
1 changed files with 15 additions and 11 deletions
|
@ -2615,6 +2615,7 @@ end
|
|||
get "/:id" do |env|
|
||||
id = env.params.url["id"]
|
||||
|
||||
if md = id.match(/[a-zA-Z0-9_-]{11}/)
|
||||
params = [] of String
|
||||
env.params.query.each do |k, v|
|
||||
params << "#{k}=#{v}"
|
||||
|
@ -2627,6 +2628,9 @@ get "/:id" do |env|
|
|||
end
|
||||
|
||||
env.redirect url
|
||||
else
|
||||
env.response.status_code = 404
|
||||
end
|
||||
end
|
||||
|
||||
error 404 do |env|
|
||||
|
|
Loading…
Reference in a new issue