From 2cb5a5e45a2fe26e0ab414705d90d714dc99f564 Mon Sep 17 00:00:00 2001 From: teddit Date: Wed, 18 Aug 2021 22:07:29 +0200 Subject: [PATCH] pass pref_quarantine_optin-cookie to get quarantined subreddits (fixes #224) --- inc/initRedditApi.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/inc/initRedditApi.js b/inc/initRedditApi.js index 2824fca..02d5ef5 100644 --- a/inc/initRedditApi.js +++ b/inc/initRedditApi.js @@ -73,12 +73,15 @@ module.exports = function(fetch) { }) } this.redditApiGETHeaders = function() { + let cookies = '_options=%7B%22pref_quarantine_optin%22%3A%20true%7D' + if(!config.use_reddit_oauth) - return { method: 'GET' } + return { headers: { cookie: cookies }, method: 'GET' } return { headers: { - Authorization: `Bearer ${reddit_access_token}` + Authorization: `Bearer ${reddit_access_token}`, + cookie: cookies }, method: 'GET' }