diff options
| author | Omar Roth <omarroth@hotmail.com> | 2018-08-07 13:18:38 -0500 |
|---|---|---|
| committer | Omar Roth <omarroth@hotmail.com> | 2018-08-07 13:18:38 -0500 |
| commit | c1bb75e616dcfef29a92141802854b569c774582 (patch) | |
| tree | 804eebf51ad99b5786d5d316df09482c80bc1bd7 | |
| parent | 0b363ff471674da89d04713ff9ebdde2efe7ce12 (diff) | |
| download | invidious-c1bb75e616dcfef29a92141802854b569c774582.tar.gz invidious-c1bb75e616dcfef29a92141802854b569c774582.tar.bz2 invidious-c1bb75e616dcfef29a92141802854b569c774582.zip | |
Add CORS headers to local URLs
| -rw-r--r-- | src/invidious.cr | 12 | ||||
| -rw-r--r-- | src/invidious/helpers/helpers.cr | 2 |
2 files changed, 13 insertions, 1 deletions
diff --git a/src/invidious.cr b/src/invidious.cr index 6e97c70e..e57dd5c6 100644 --- a/src/invidious.cr +++ b/src/invidious.cr @@ -2689,6 +2689,18 @@ options "/videoplayback/*" do |env| env.response.headers["Access-Control-Allow-Headers"] = "Content-Type, range" end +options "/api/manifest/dash/id/videoplayback" 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 + +options "/api/manifest/dash/id/videoplayback/*" 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| path = env.request.path diff --git a/src/invidious/helpers/helpers.cr b/src/invidious/helpers/helpers.cr index 874927e5..fcc191f6 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", "/api/*"] def call(env) return call_next env if exclude_match? env |
