Skip to content

Commit

Permalink
fix bug handling cache header (#78)
Browse files Browse the repository at this point in the history
  • Loading branch information
aureliendavid committed Jun 19, 2023
1 parent 910f4a4 commit 94c35d9
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
9 changes: 8 additions & 1 deletion background.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,12 @@ function detectFeed(event) {
}

if (isfeed) {

var cache_idx = null;

for (let i = 0; i < event.responseHeaders.length; i++) {
if (event.responseHeaders[i].name.toLowerCase() == 'cache-control') {
event.responseHeaders.splice(i, 1);
cache_idx = i;
}
else if (event.responseHeaders[i].name.toLowerCase() == 'content-security-policy') {

Expand All @@ -39,6 +42,10 @@ function detectFeed(event) {
}
}

if (cache_idx) {
event.responseHeaders.splice(cache_idx, 1);
}

// don't cache requests we modified
// otherwise on reload the content-type won't be modified again
event.responseHeaders.push({
Expand Down
2 changes: 1 addition & 1 deletion manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

"manifest_version": 2,
"name": "RSSPreview",
"version": "3.20.1",
"version": "3.20.2",
"author": "Aurelien David",
"homepage_url": "https://github.com/aureliendavid/rsspreview",

Expand Down

0 comments on commit 94c35d9

Please sign in to comment.