question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

post request results in timeout when providing body, header, or both

See original GitHub issue

Prerequisites

Environment check

  • I’m using the latest msw version
  • I’m using Node.js version 14 or higher

Node.js version

14 / 16

Reproduction repository

https://codesandbox.io/s/laughing-ully-x4wt2w

Reproduction steps

open provided CodeSandbox and run npm test; only the test case executing a POST request with neither body nor header provided succeeds, the others fail

Current behavior

When providing data (i.e. body) to a POST request, the test ends in a timeout. A breakpoint within the request handler of the ‘mocked server’ is not even reached.

The exact same request when used against a ‘real’ nodeJS server (express)

Expected behavior

The tests should not result in a timeout and instead get processed by the handler.

I can not rule out, that my set up is wrong, however i followed the instructions to the best of my knowledge and understanding

Issue Analytics

  • State:closed
  • Created a year ago
  • Reactions:3
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

2reactions
josuevalrobcommented, May 24, 2022

oh fck, same issue for me

2reactions
mbastian93commented, Mar 29, 2022

Okay i just noticed: when using jest/babel-jest v^26.0.0 it works as expect. Therefore there must be an issue with v27 of those libaries

Read more comments on GitHub >

github_iconTop Results From Across the Web

I get a timeout when getting a response from a POST HTTP ...
I was able to fix it and get the response by closing the TCP connection. I inserted a key and value pair in...
Read more >
408 Request Timeout - HTTP - MDN Web Docs
It is sent on an idle connection by some servers, even without any previous request by the client.
Read more >
Http request timeout - OSS Support - k6 community forum
I am trying to use the timeout param for one http request that can take more than 60s to return, but it seems...
Read more >
HTTP request timeouts in Go for beginners - ITNEXT
The http request timeout can be defined on the client side using multiple ... Request Header , Request Body , Response Header and...
Read more >
Slow HTTP POST vulnerability - Qualys Discussions
Is there any other way to mitigate this vulnerability? ... scanner from Slow Http Post: slow down in headers section or in message...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found