You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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 https://github.com/joho/7XX-rfc
The text was updated successfully, but these errors were encountered:
Considering that HTTP/2 removes this misfeature and HTTP/2 is the future, I'm closing
this as WontFix.
HTTP/2 says:
"""
8.1.2.4 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 8.1.2.6).
HTTP/2 does not define a way to carry the version or reason phrase that is included in
an HTTP/1.1 status line.
"""
The text was updated successfully, but these errors were encountered: