Skip to content

Commit b8b4016

Browse files
authored
Fetch: disable push (#574)
* fetch: disable pushes * upgrade adobe/fetch to 4.1.1
1 parent 45e2011 commit b8b4016

File tree

3 files changed

+1719
-1386
lines changed

3 files changed

+1719
-1386
lines changed

lib/fetch.js

+12-2
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@ const fetchKeepAlive = noCache({
77
h1: {
88
keepAlive: true
99
},
10+
h2: {
11+
enablePush: false
12+
},
1013
rejectUnauthorized: false // By default skip auth check for all.
1114
}).fetch;
1215

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

20-
const fetchAuthorized = noCache().fetch; // `rejectUnauthorized: true` - by `fetch` default.
23+
const fetchAuthorized = noCache({
24+
h2: {
25+
enablePush: false
26+
}
27+
}).fetch; // `rejectUnauthorized: true` - by `fetch` default.
2128
const fetchH1Authorized = h1NoCache().fetch; // `rejectUnauthorized: true` - by `fetch` default.
2229

2330
const { fetch } = noCache({
31+
h2: {
32+
enablePush: false
33+
},
2434
rejectUnauthorized: false // By default skip auth check for all.
2535
});
2636

@@ -270,4 +280,4 @@ export function setCookieFromJar(headers, jar) {
270280
var cookies = Object.entries(jar).map(([k,v]) => serializeCookie(k, v)).join('; ');
271281
headers['Cookie'] = cookies;
272282
}
273-
}
283+
}

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
},
2121
"license": "MIT",
2222
"dependencies": {
23-
"@adobe/fetch": "^4.0.6",
23+
"@adobe/fetch": "^4.1.11",
2424
"async": "^3.2.4",
2525
"cheerio": "^0.22.0",
2626
"chokidar": "^3.5.3",

0 commit comments

Comments
 (0)