-
Notifications
You must be signed in to change notification settings - Fork 2
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鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
.end overwrites res.body with the last character #26
Comments
ErisDS
added a commit
to ErisDS/reqresnext
that referenced
this issue
Jan 25, 2022
fixes: antongolub#26 - added a test to demonstrate how write and end are used together that should fail with the current code - use the already bound write method to ensure that body is concatenated correctly - this seemed like the quickest way to do this, as callback isn't used
antongolub
pushed a commit
that referenced
this issue
Jan 26, 2022
fixes: #26 - added a test to demonstrate how write and end are used together that should fail with the current code - use the already bound write method to ensure that body is concatenated correctly - this seemed like the quickest way to do this, as callback isn't used
馃帀 This issue has been resolved in version 1.6.5 馃帀 The release is available on: Your semantic-release bot 馃摝馃殌 |
ErisDS
added a commit
to ErisDS/framework
that referenced
this issue
Jan 26, 2022
- the main change here is to add express-session and a login and authenticated endpoint so I can start figuring out how to get the agent to maintain cookies - however I found a really weird issue where as soon as you add express-session then express starts acting differently & breaks reqresnext - at this point both res.write and res.end get called, where res.end only gets the last char - because reqresnext's end method doesn't concatenate with write, you only get the last char returned - therefore I've had to add a workaround in lieu of antongolub/reqresnext#26 being looked at
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I've been experimenting with reqresnext as a way to write performant tests against express.
Today I ran into a weird issue where I suddenly started only getting the very last character of my content 馃
It was happening every time I wired up
express-session
to my express app. It seems that once you add session handling both res.write and res.end are called internally.The code here in reqresnext overwrites body on res.end rather than concatenating and res.end is only getting called with the final character.
My minimal repo case looks something like this:
You'll get "TEXT !" as the output.
If you comment out the lines
You'll get "TEXT Hello World!" as expected.
I'm able to fix it by changing adding this to reqres.js
The text was updated successfully, but these errors were encountered: