You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
constfetch=require('node-fetch');consthttp=require('http');constserver=http.createServer((request,response)=>{response.setHeader('content-encoding','deflate');// change this to gzip and it worksresponse.end();});server.listen(8080);(async()=>{constresponse=awaitfetch('http://localhost:8080');consttext=awaitresponse.text();console.log('Result:',text);server.close();})();
Looks like you're missing
+ let hasData = false;
raw.once('data', chunk => {
+ hasData = true;
// See http://stackoverflow.com/questions/37519828
body = (chunk[0] & 0x0F) === 0x08 ? pump(body, zlib.createInflate(), reject) : pump(body, zlib.createInflateRaw(), reject);
response = new Response(body, responseOptions);
resolve(response);
});
++ raw.once('end', () => {+ if (!hasData) {+ response = new Response(body, responseOptions);+ resolve(response);+ }+ });
Looks like you're missing
before
node-fetch/src/index.js
Line 292 in 41f53b9
The text was updated successfully, but these errors were encountered: