From 20b961c1c8b59a608ad7b28754d1976b6b411932 Mon Sep 17 00:00:00 2001 From: syeopite Date: Fri, 2 Apr 2021 17:08:55 -0700 Subject: [PATCH] Preserve original cookies --- src/invidious/helpers/utils.cr | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/invidious/helpers/utils.cr b/src/invidious/helpers/utils.cr index 92d8a7bb..67f496df 100644 --- a/src/invidious/helpers/utils.cr +++ b/src/invidious/helpers/utils.cr @@ -9,7 +9,8 @@ def add_yt_headers(request) return if request.resource.starts_with? "/sorry/index" request.headers["x-youtube-client-name"] ||= "1" request.headers["x-youtube-client-version"] ||= "2.20200609" - request.headers["cookie"] = "CONSENT=YES+" # New YT consent cookie for EU servers + # Preserve original cookies and add new YT consent cookie for EU servers + request.headers["cookie"] = "#{request.headers["cookie"]?}; CONSENT=YES+" if !CONFIG.cookies.empty? request.headers["cookie"] = "#{(CONFIG.cookies.map { |c| "#{c.name}=#{c.value}" }).join("; ")}; #{request.headers["cookie"]?}" end