Skip to content

When simulating close, ensure res emits close.#139

Merged
devinivy merged 1 commit intohapijs:masterfrom
devinivy:res-close-minimal
Jan 23, 2021
Merged

When simulating close, ensure res emits close.#139
devinivy merged 1 commit intohapijs:masterfrom
devinivy:res-close-minimal

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