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
I was making a request that had a string with a special character. In a buffer the character's size is 3 instead of the regular 1. The request would fail with a socket hang up and it took awhile to figure out why the request was failing. If there could be a more detailed error message for when there is a mismatch between the content-length and the actual payload that would be appreciated.
{ Error: socket hang up
at createHangUpError (_http_client.js:302:15)
at Socket.socketOnEnd (_http_client.js:394:23)
at emitNone (events.js:91:20)
at Socket.emit (events.js:186:7)
at endReadableNT (_stream_readable.js:974:12)
at _combinedTickCallback (internal/process/next_tick.js:74:11)
at process._tickCallback (internal/process/next_tick.js:98:9) code: 'ECONNRESET' }
The text was updated successfully, but these errors were encountered:
I'm getting a socket hang up with this example even when the content length is the correct byte length. The parser is receiving the body but the response callback isn't happening.
The client's socket hang up happens because the server closes the connection, if I read the stack trace right.
To get the requested behavior of an 'Incorrect content-length' error, the client would need to keep track of how much bytes have been written and check that against the Content-Length header, but that's a bad idea because it adds considerable overhead.
Subsystem: http - ClientRequest
I was making a request that had a string with a special character. In a buffer the character's size is 3 instead of the regular 1. The request would fail with a socket hang up and it took awhile to figure out why the request was failing. If there could be a more detailed error message for when there is a mismatch between the content-length and the actual payload that would be appreciated.
Simplest Example to Reproduce
Expected Behavior
Current Behavior
The text was updated successfully, but these errors were encountered: