1
0
mirror of https://github.com/iv-org/invidious.git synced 2024-12-22 14:05:09 -05:00

Skip preferences for assets

This commit is contained in:
Omar Roth 2019-11-20 12:03:52 -05:00
parent 05988c1c49
commit 276bf09238
No known key found for this signature in database
GPG Key ID: B8254FB7EC3D37F2

View File

@ -255,6 +255,17 @@ before_all do |env|
env.response.headers["Strict-Transport-Security"] = "max-age=31536000; includeSubDomains; preload"
end
next if {
"/sb/",
"/vi/",
"/s_p/",
"/yts/",
"/ggpht/",
"/api/manifest/",
"/videoplayback",
"/latest_version",
}.any? { |r| env.request.resource.starts_with? r }
begin
preferences = Preferences.from_json(env.request.cookies["PREFS"]?.try &.value || "{}")
rescue