mirror of
https://github.com/iv-org/invidious.git
synced 2024-12-22 16:19:53 +05:30
Add workaround for storyboards on priv. instances
An upstream problem with videojs-vtt-thumbnails means that URLs gets joined incorrectly on any instance where `domain`, `external_port` and `https_only` aren't set. This commit adds some logic with the 404 handler to mitigate this problem. This is however only a workaround. See: https://github.com/iv-org/invidious/issues/3117 https://github.com/chrisboustead/videojs-vtt-thumbnails/issues/31
This commit is contained in:
parent
3450896602
commit
a81c0f329c
@ -1,5 +1,10 @@
|
|||||||
module Invidious::Routes::ErrorRoutes
|
module Invidious::Routes::ErrorRoutes
|
||||||
def self.error_404(env)
|
def self.error_404(env)
|
||||||
|
# Workaround for # 3117
|
||||||
|
if HOST_URL.empty? && env.request.path.starts_with?("/v1/storyboards/sb")
|
||||||
|
return env.redirect "#{env.request.path[15..]}?#{env.params.query}"
|
||||||
|
end
|
||||||
|
|
||||||
if md = env.request.path.match(/^\/(?<id>([a-zA-Z0-9_-]{11})|(\w+))$/)
|
if md = env.request.path.match(/^\/(?<id>([a-zA-Z0-9_-]{11})|(\w+))$/)
|
||||||
item = md["id"]
|
item = md["id"]
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user