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

Fix #1565: Return 444 status code for closed and aborted requests #1579

Merged

Conversation

benjaminRomano
Copy link
Contributor

@benjaminRomano benjaminRomano commented Dec 1, 2017

@DonutEspresso

Issues

Closes:

Changes

Sets the response status code to 444 for aborted or closed requests.

The client will never see this response. This is solely for plugins like audit-logger and metrics to record an accurate statusCode instead of what was set using res.send

Copy link
Member

@retrohacker retrohacker left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This LGTM 👍

@retrohacker
Copy link
Member

Thanks for this @benjaminRomano

IIRC we just did something similar at another layer in our stack @DonutEspresso?

@DonutEspresso
Copy link
Member

Awesome, thank you for this PR @benjaminRomano, 💯 for including tests!

Only one minor point of feedback - I would prefer we check against the connectionStates aborted or close before setting the status code. In the event that should we introduce a new connectionState, such a check would make sure we're not setting 444 for all cases where it may not be applicable.

Aside from that, LGTM.

@benjaminRomano
Copy link
Contributor Author

👍 I agree checking connectionState explicitly is safer. I've updated the PR

@DonutEspresso

@benjaminRomano
Copy link
Contributor Author

@retrohacker I believe this is ready to be merged

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants