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
このコミットが含まれているのは:
syeopite 2023-08-08 15:13:23 -07:00
コミット a81c0f329c
この署名に対応する既知のキーがデータベースに存在しません
GPGキーID: A73C186DA3955A1A
1個のファイルの変更5行の追加0行の削除

ファイルの表示

@ -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"]