Skip to content

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
Contributor

@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
Contributor

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.

3 participants