summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOmar Roth <omarroth@protonmail.com>2019-11-20 12:03:52 -0500
committerOmar Roth <omarroth@protonmail.com>2019-11-20 12:04:53 -0500
commit276bf09238103aaabe64be09b9ac10f976510ff7 (patch)
tree79815c614a6afd13c78a8f5d2e2bd87586d1c948
parent05988c1c49851b7d0094fca16aeaf6382a7f64ab (diff)
downloadinvidious-276bf09238103aaabe64be09b9ac10f976510ff7.tar.gz
invidious-276bf09238103aaabe64be09b9ac10f976510ff7.tar.bz2
invidious-276bf09238103aaabe64be09b9ac10f976510ff7.zip
Skip preferences for assets
-rw-r--r--src/invidious.cr11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/invidious.cr b/src/invidious.cr
index a766a11c..559214ac 100644
--- a/src/invidious.cr
+++ b/src/invidious.cr
@@ -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