-
Notifications
You must be signed in to change notification settings - Fork 18k
net/http: StatusText(416) returns "Requested Range Not Satisfiable" should be "Range Not Satisfiable" #42276
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
Comments
Thank you for this question @rob05c and welcome to the Go project! So firstly we've had this status message for the past 11+ years without a complaint. RFC 7233 was made in 2014 aka >6 years ago. Data from surveyTo survey prominent infrastructure on the internet to see if we've deviated, or perhaps as motivation for if we should change it, backed by data on what others have done: ResultsOf the 14 surveyed popular/critical internet infrastructure, only 3 use that newer RFC's definition -> 21.43% ConclusionGiven that that might be a sudden change that hasn't been propagated to majority of the surveyed infrastructure as per above, I don't think we should make this change. Despite it being low-risk and not necessarily under the Go1 compatibility promise as it is a status message so amenable, by Hyrum's law, a change (moreover after 11+ years) is bound to break code for someone, and no report has come in in the past 6+ years since its introduction. I thus vote to say let's not change this, but definitely a consideration for Go2, which will give enough time perhaps for maturity of that RFC and adoption by others too. |
@bradfitz @rsc @agl @FiloSottile what do y'all think, as per the survey I've conducted in #42276 (comment)? |
What is the current state of this? As per renewed RFC 9110 which deprecates the obsolete drafts and older RFCs, this is still wrongly implemented in The code itself even quotes RFC 9110, section 15.5.17, but still uses the wrong "Requested Range Not Satisfiable" message. |
As the original author, I'll note
|
RFC 7233 defines 416 as "Range Not Satisfiable". This was previously "Requested Range Not Satisfiable" in RFC 2616, which is obsolete.
https://tools.ietf.org/html/rfc7233#section-4.4
But everywhere this occurs, whether it's user code calling
http.StatusText
, orhttp.ServeFile
when a client requests a bad range, Go gives the client416 Requested Range Not Satisfiable
when the canonical text is416 Range Not Satisfiable
.Obviously
http.StatusRequestedRangeNotSatisfiable
will have to stay to avoid breaking compatibility, but:statusText[StatusRequestedRangeNotSatisfiable]
be changed to"Range Not Satisfiable"
?http.StatusRangeNotSatisfiable
be added?http.StatusRequestedRangeNotSatisfiable
be removed in Go 2?And yes, I realize this is the minorest of issues.
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
Yes.
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
http.StatusText(416)
http.StatusText(http.StatusRequestedRangeNotSatisfiable)
What did you expect to see?
"Range Not Satisfiable"
What did you see instead?
"Requested Range Not Satisfiable"
The text was updated successfully, but these errors were encountered: