From 94c6450401f65255e3c958505da5ad1c56798ec2 Mon Sep 17 00:00:00 2001 From: ManeraKai Date: Thu, 24 Mar 2022 06:17:12 +0300 Subject: [PATCH] Fixed bug with responseHeaders #135 --- src/assets/javascripts/helpers/twitter.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/assets/javascripts/helpers/twitter.js b/src/assets/javascripts/helpers/twitter.js index bacbdcfc..4f24af39 100644 --- a/src/assets/javascripts/helpers/twitter.js +++ b/src/assets/javascripts/helpers/twitter.js @@ -194,8 +194,12 @@ function removeXFrameOptions(e) { ...nitterTorCustomRedirects, ]; if (!twitterList.includes(protocolHost) && e.type != 'sub_frame') return; - for (const i in e.responseHeaders) if (e.responseHeaders[i].name = 'x-frame-options') e.responseHeaders.splice(i, 1); - return { responseHeaders: e.responseHeaders }; + let isChanged = false; + for (const i in e.responseHeaders) if (e.responseHeaders[i].name = 'x-frame-options') { + isChanged = true; + e.responseHeaders.splice(i, 1); + } + if (isChanged) return { responseHeaders: e.responseHeaders }; } function isNitter(url, type) {