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

net/http: support custom status text in server #8990

DanielMorsing opened this issue Oct 24, 2014 · 2 comments


None yet
4 participants
Copy link

commented Oct 24, 2014

Right now, there's no way to use a custom status text when using the net/http server.
This is mostly a problem when proxying requests for other servers.

While conforming programs are only supposed to look at the error code, we occasionally
see people caring about the text.

APIs have a tendency to define new status codes all the time and there's no way that
http.StatusText can keep up with these. This is a problem since some APIs don't properly
document the codes that they haphazardly define, so a programmer can only rely on the
status text for figuring out what exactly went wrong.

Other examples of weird status texts seen in the wild include links to job pages and
this thing

This comment has been minimized.

Copy link

commented Oct 24, 2014

Comment 1:

Labels changed: added release-go1.5.


This comment has been minimized.

Copy link

commented Nov 14, 2014

Comment 2:

Considering that HTTP/2 removes this misfeature and HTTP/2 is the future, I'm closing
this as WontFix.
HTTP/2 says:
""" Response Pseudo-Header Fields
For HTTP/2 responses, a single :status pseudo-header field is defined that carries the
HTTP status code field (see [RFC7231], Section 6). This pseudo-header field MUST be
included in all responses, otherwise the response is malformed (Section
HTTP/2 does not define a way to carry the version or reason phrase that is included in
an HTTP/1.1 status line.

Status changed to WontFix.

This issue was closed.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
You can’t perform that action at this time.