-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
feat: ability to edit status messages #1126
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think this is a good idea. I would rather add a statusLine []byte
field to ResponseHeader
and methods to set it. And when it's set it should be used here, otherwise use the current code:
Line 1642 in 81fc968
dst = append(dst, statusLine(statusCode)...) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You also need to reset h.statusLine
in the Reset
method.
Thanks! |
I'm in need to change the message associated with the status of a request. In my context: when millions of RPS are answered with 204, every byte of the response counts towards reducing AWS transfer out costs, so "NC" instead of "No Content" is a small change with big impact.
To do so, I've created
SetStatusMessage
. Also I've extracted the set of thestatusLines
to reuse it in said function.I await for you input! Thanks!