mirror of
https://gitea.invidious.io/iv-org/invidious
synced 2025-06-05 23:29:12 +02:00
Fix 404 handling for endpoints matching short URLs
This commit is contained in:
@ -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"]))
|
||||
|
||||
|
Reference in New Issue
Block a user