New issue
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
POST request with ReadStream request body does not return a response #2595
Comments
@busma13 any chance the regression is in |
It could definitely be |
Hey @busma13, have you gotten any further with this? We're having a similar issue on taskcluster while trying to upgrade to the latest version of node. |
@matt-boris No I haven't, we were okay with disabling the test because the function was covered well in e2e testing, so it lost priority. I wanted to search through the |
@busma13 yes, we're using |
I think this is a got issue and not a nock issue as I did a quick switch to use axios instead of got and it worked UPDATE: this was using got v13.0.0 |
As a minimal recreate. The oddness is that if I switch the url to |
Thanks for verifying this! |
Thanks @stephen-willoughby |
because nock/nock#2595 the issue seems to have been introduced in node.js 20.10 taskcluster/taskcluster#6923
Any chance this could be reopened? got aren't interested in addressing it. And it seems to specifically be around the use of both got and nock. On sindresorhus/got#2341 someone has suggested a workaround, with a patch of nock, but I've no idea of its validity |
Please avoid duplicates
Reproducible test case
https://github.com/busma13/nock-stream-test
Nock Version
13.5.4
Node Version
20.10.0
TypeScript Version
No response
What happened?
I'm using
got
to send a post request to an api that will upload a file. The request body contains aReadStream
of the file to be uploaded. In my jest test Nock successfully intercepts the request, theInterceptedRequestRouter
class callshandleWrite()
, buthandleEnd()
is never called. It will hang until the jest test times out.If I switch to node version 20.9.0 or previous Nock will successfully read the stream and return a response.
Would you be interested in contributing a fix?
The text was updated successfully, but these errors were encountered: