Skip to content

Commit

Permalink
Fetch: disable push (#574)
Browse files Browse the repository at this point in the history
* fetch: disable pushes

* upgrade adobe/fetch to 4.1.1
  • Loading branch information
nleush authored Jan 15, 2025
1 parent 45e2011 commit b8b4016
Show file tree
Hide file tree
Showing 3 changed files with 1,719 additions and 1,386 deletions.
14 changes: 12 additions & 2 deletions lib/fetch.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ const fetchKeepAlive = noCache({
h1: {
keepAlive: true
},
h2: {
enablePush: false
},
rejectUnauthorized: false // By default skip auth check for all.
}).fetch;

Expand All @@ -17,10 +20,17 @@ const fetchH1KeepAlive = h1NoCache({
rejectUnauthorized: false // By default skip auth check for all.
}).fetch;

const fetchAuthorized = noCache().fetch; // `rejectUnauthorized: true` - by `fetch` default.
const fetchAuthorized = noCache({
h2: {
enablePush: false
}
}).fetch; // `rejectUnauthorized: true` - by `fetch` default.
const fetchH1Authorized = h1NoCache().fetch; // `rejectUnauthorized: true` - by `fetch` default.

const { fetch } = noCache({
h2: {
enablePush: false
},
rejectUnauthorized: false // By default skip auth check for all.
});

Expand Down Expand Up @@ -270,4 +280,4 @@ export function setCookieFromJar(headers, jar) {
var cookies = Object.entries(jar).map(([k,v]) => serializeCookie(k, v)).join('; ');
headers['Cookie'] = cookies;
}
}
}
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
},
"license": "MIT",
"dependencies": {
"@adobe/fetch": "^4.0.6",
"@adobe/fetch": "^4.1.11",
"async": "^3.2.4",
"cheerio": "^0.22.0",
"chokidar": "^3.5.3",
Expand Down
Loading

0 comments on commit b8b4016

Please sign in to comment.