diff options
| author | TheFrenchGhosty <47571719+TheFrenchGhosty@users.noreply.github.com> | 2021-04-03 09:40:25 +0000 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-04-03 09:40:25 +0000 |
| commit | cb378c1754d2424ed22eaaf8f0d0830e4c978b3b (patch) | |
| tree | 4bfa318fa57b4c7448ce5f4286e7eb17a5bf4169 | |
| parent | c4c2e01213c8cd8356d2380aabfdf68c1772de8c (diff) | |
| parent | 20b961c1c8b59a608ad7b28754d1976b6b411932 (diff) | |
| download | invidious-cb378c1754d2424ed22eaaf8f0d0830e4c978b3b.tar.gz invidious-cb378c1754d2424ed22eaaf8f0d0830e4c978b3b.tar.bz2 invidious-cb378c1754d2424ed22eaaf8f0d0830e4c978b3b.zip | |
Merge pull request #1973 from syeopite/fixcomments
Preserve all original cookies when adding the consent cookie.
| -rw-r--r-- | src/invidious/helpers/utils.cr | 3 |
1 files changed, 2 insertions, 1 deletions
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 |
