net/http: ServeContent sends 416 Requested Range Not Satisfiable when content is empty and range include 0 #54794
Labels
FrozenDueToAge
help wanted
NeedsFix
The path to resolution is known, but the work has not been done.
Milestone
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
Yes (
go1.19
)What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
Run this code:
What did you expect to see?
A 200 with the "complete" file:
What did you see instead?
Comments
FWIW Nginx's behaviour is
200
and this is my prefered solution (nothing forces the server to always use requested ranges, you can always decide to override this and send200
).RFC7233 specify
[x,y]
ranging.Reason it's a problem
This make our go backend clash with our nginx caching reverse proxy because we have fragment caching enabled and therefore add a header "Range: bytes=0-1048575" to any requests that dont already have them (which is common practice).
See ipfs/kubo#9238
The text was updated successfully, but these errors were encountered: