golang / go

The Go programming language
https://go.dev
BSD 3-Clause "New" or "Revised" License
124.4k stars 17.7k forks source link

net/http: Range request edge case #8988

Closed gopherbot closed 9 years ago

gopherbot commented 10 years ago

by jed@fastly.com:

There's currently a bug with ServeContent and FileServer when handling Range requests.

Given a file of size N, a request for "Range: bytes=N-*" should return a 416. 
However, currently, it returns 206, a body of 0 bytes, and the illegal Content-Range of
"bytes N-(N-1)/N".
gopherbot commented 10 years ago

Comment 1:

CL https://golang.org/cl/163820043 mentions this issue.
gopherbot commented 10 years ago

Comment 2 by jed@fastly.com:

A fix for this issue is pending review: https://golang.org/cl/163820043
ianlancetaylor commented 10 years ago

Comment 3:

Labels changed: added repo-main, release-go1.5.

jeddenlea commented 9 years ago

The fix has been moved to https://go-review.googlesource.com/#/c/1862

mikioh commented 9 years ago

Can you please consult for RFC 7233 instead of RFC 2616? I'm not sure how much impact will we have on http://tools.ietf.org/html/rfc7233#appendix-B.

jeddenlea commented 9 years ago

So far as I can reason, the updated RFC doesn't change what should be done in the case this CL addresses. But I will update the language quoted in the change description.