grantila / fetch-h2

HTTP/1+2 Fetch API client for Node.js
MIT License
336 stars 16 forks source link

disconnectAll() throws "Error: unexpected end of file" #97

Closed stefan-guggisberg closed 2 years ago

stefan-guggisberg commented 4 years ago

To reproduce:

const { fetch, disconnectAll } = require('fetch-h2');

(async function () {
  let resp = await fetch('https://api.fastly.com/public-ip-list');
  // don't read body
  await disconnectAll();  // => throws error
}());

Running above code gives the following error:

events.js:288
      throw er; // Unhandled 'error' event
      ^

Error: unexpected end of file
    at Zlib.zlibOnError [as onerror] (zlib.js:180:17)
Emitted 'error' event on Gunzip instance at:
    at Zlib.zlibOnError [as onerror] (zlib.js:183:8) {
  errno: -5,
  code: 'Z_BUF_ERROR'
}
grantila commented 2 years ago

This I think is actually fixed, although not sure in which version. I can't personally reproduce. Please re-open if you can reproduce it again (and with which Node version), thanks!