Skip to content
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

When simulating close, ensure res emits close. #139

Merged
merged 1 commit into from
Jan 23, 2021

Conversation

devinivy
Copy link
Member

In followup to #138 I've implemented the proposed fix. By looking at #138 you can see that the changes are nearly identical, but here we only handle the case of simulating a close rather than ensuring that res always emits 'close' any time req emits 'close'.

It's worth mentioning I also experimented with a separate approach of using the socket to propagate these events (as is done internally to node). My hope was that shot would then inherit a nice subset of node behaviors, and in turn be more accurate to a real/live http server. It was interesting and there were some positive results, but it was more complex and wasn't the right approach to address this particular issue.

Refs: hapijs/hapi#4208

I tested these changes with hapi against node v15.5.1, v14.15.4, and v12.19.1.

@devinivy devinivy added the bug Bug or defect label Jan 22, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Bug or defect
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants