From 3c359df22edd34a9870c9021271f02b2a1fd2618 Mon Sep 17 00:00:00 2001 From: Omar Roth Date: Mon, 6 Aug 2018 22:42:11 -0500 Subject: [PATCH] Fix routing for '/videoplayback'' --- src/invidious.cr | 4 ++-- src/invidious/helpers/helpers.cr | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/invidious.cr b/src/invidious.cr index 77e53589..9d2a5924 100644 --- a/src/invidious.cr +++ b/src/invidious.cr @@ -2635,13 +2635,13 @@ get "/api/manifest/hls_playlist/*" do |env| manifest end -options "/videoplayback*" do |env| +options "/videoplayback/:wild/*" do |env| env.response.headers["Access-Control-Allow-Origin"] = "*" env.response.headers["Access-Control-Allow-Methods"] = "GET" env.response.headers["Access-Control-Allow-Headers"] = "Content-Type, range" end -get "/videoplayback*" do |env| +get "/videoplayback/:wild/*" do |env| path = env.request.path if path != "/videoplayback" path = path.lchop("/videoplayback/") diff --git a/src/invidious/helpers/helpers.cr b/src/invidious/helpers/helpers.cr index fcc191f6..a7b202a9 100644 --- a/src/invidious/helpers/helpers.cr +++ b/src/invidious/helpers/helpers.cr @@ -17,7 +17,7 @@ class Config end class FilteredCompressHandler < Kemal::Handler - exclude ["/videoplayback", "/api/*"] + exclude ["/videoplayback/:wild/*", "/api/*"] def call(env) return call_next env if exclude_match? env