mirror of
https://gitea.invidious.io/iv-org/invidious-copy-2022-03-16.git
synced 2024-08-15 00:53:18 +00:00
Fix 404 handling for endpoints matching short URLs
This commit is contained in:
parent
27e032d10d
commit
f065a21542
1 changed files with 42 additions and 37 deletions
|
@ -5058,6 +5058,11 @@ error 404 do |env|
|
|||
response = client.get(response.headers["Location"])
|
||||
end
|
||||
|
||||
if response.body.empty?
|
||||
env.response.headers["Location"] = "/"
|
||||
halt env, status_code: 302
|
||||
end
|
||||
|
||||
html = XML.parse_html(response.body)
|
||||
ucid = html.xpath_node(%q(//meta[@itemprop="channelId"]))
|
||||
|
||||
|
|
Loading…
Reference in a new issue