From 276bf09238103aaabe64be09b9ac10f976510ff7 Mon Sep 17 00:00:00 2001 From: Omar Roth Date: Wed, 20 Nov 2019 12:03:52 -0500 Subject: [PATCH] Skip preferences for assets --- src/invidious.cr | 11 +++++++++++ 1 file changed, 11 insertions(+) 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