diff options
| author | syeopite <syeopite@syeopite.dev> | 2023-08-08 15:13:23 -0700 |
|---|---|---|
| committer | syeopite <syeopite@syeopite.dev> | 2023-08-08 15:13:23 -0700 |
| commit | a81c0f329cfe0ef343c31636b74615e91e613f72 (patch) | |
| tree | 99852986c237ce30020c3dd95fab1880a5b8384c /src | |
| parent | 34508966027fce3f460d9670eeecef67b92565a0 (diff) | |
| download | invidious-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
Diffstat (limited to 'src')
| -rw-r--r-- | src/invidious/routes/errors.cr | 5 |
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"] |
