summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorsyeopite <syeopite@syeopite.dev>2023-08-08 15:13:23 -0700
committersyeopite <syeopite@syeopite.dev>2023-08-08 15:13:23 -0700
commita81c0f329cfe0ef343c31636b74615e91e613f72 (patch)
tree99852986c237ce30020c3dd95fab1880a5b8384c
parent34508966027fce3f460d9670eeecef67b92565a0 (diff)
downloadinvidious-a81c0f329cfe0ef343c31636b74615e91e613f72.tar.gz
invidious-a81c0f329cfe0ef343c31636b74615e91e613f72.tar.bz2
invidious-a81c0f329cfe0ef343c31636b74615e91e613f72.zip
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
-rw-r--r--src/invidious/routes/errors.cr5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/invidious/routes/errors.cr b/src/invidious/routes/errors.cr
index b138b562..4d8d9ee8 100644
--- a/src/invidious/routes/errors.cr
+++ b/src/invidious/routes/errors.cr
@@ -1,5 +1,10 @@
module Invidious::Routes::ErrorRoutes
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+))$/)
item = md["id"]