mirror of
https://github.com/iv-org/invidious.git
synced 2024-11-30 02:32:56 +05:30
Add CORS headers to local URLs
This commit is contained in:
parent
0b363ff471
commit
c1bb75e616
@ -2689,6 +2689,18 @@ options "/videoplayback/*" do |env|
|
|||||||
env.response.headers["Access-Control-Allow-Headers"] = "Content-Type, range"
|
env.response.headers["Access-Control-Allow-Headers"] = "Content-Type, range"
|
||||||
end
|
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|
|
get "/videoplayback/*" do |env|
|
||||||
path = env.request.path
|
path = env.request.path
|
||||||
|
|
||||||
|
@ -17,7 +17,7 @@ class Config
|
|||||||
end
|
end
|
||||||
|
|
||||||
class FilteredCompressHandler < Kemal::Handler
|
class FilteredCompressHandler < Kemal::Handler
|
||||||
exclude ["/videoplayback/*", "/api/*"]
|
exclude ["/videoplayback", "/api/*"]
|
||||||
|
|
||||||
def call(env)
|
def call(env)
|
||||||
return call_next env if exclude_match? env
|
return call_next env if exclude_match? env
|
||||||
|
Loading…
Reference in New Issue
Block a user