We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Requesting a redirected resource over HTTP2 causes sudden process exit with code 0.
Code to reproduce:
const { fetch, disconnectAll } = require('fetch-h2'); const ts0 = Date.now(); process.on('exit', (code) => { const ts1 = Date.now(); console.log(`exited after ${ts1 - ts0} ms with code: ${code}`); }); (async () => { try { const url = 'https://nghttp2.org/httpbin/absolute-redirect/1'; console.log(`fetching ${url} ...`); const resp = await fetch(url, { redirect: 'follow', }); console.log(`Status: ${resp.status}, HTTP Version: ${resp.httpVersion}, redirected: ${resp.redirected}`); console.log(`Body:\n${await resp.text()}`); } catch (e) { console.error(e); throw e; } finally { await disconnectAll(); } })();
Running above code produces the following console output:
fetching https://nghttp2.org/httpbin/absolute-redirect/3 ... exited after 808 ms with code: 0
The process exits during the fetch call with code 0 (success) because somehow no more async operations were pending.
fetch
This is a regression of changes introduced in version 2.4.0. All versions since 2.4.0 are affected. 2.3.0 OTOH does work as expected.
2.4.0
2.3.0
Workarounds:
require('fetch-h2').context({ httpsProtocols: ['http1'] })
setTimeout(...)
The text was updated successfully, but these errors were encountered:
Note: I can't reproduce the issue in a Mocha test. Probably because Mocha runs the tests in forked child processes.
Sorry, something went wrong.
@grantila This is a serious issue for us. Could you please have a look or at least direct me to the code that need's to be fixed?
8274929
feat(core): added support for absolute redirections
c22c63c
Also fixed async ref issue with http2 relative redirections fix #107
🎉 This issue has been resolved in version 2.5.0 🎉
The release is available on:
Your semantic-release bot 📦🚀
No branches or pull requests
Requesting a redirected resource over HTTP2 causes sudden process exit with code 0.
Code to reproduce:
Running above code produces the following console output:
The process exits during the
fetch
call with code 0 (success) because somehow no more async operations were pending.This is a regression of changes introduced in version
2.4.0
. All versions since2.4.0
are affected.2.3.0
OTOH does work as expected.Workarounds:
require('fetch-h2').context({ httpsProtocols: ['http1'] })
setTimeout(...)
)The text was updated successfully, but these errors were encountered: