net/http: http.FileServer Partial Content returns no content #27085
Comments
(I'm not able to reproduce this with |
my guess that error happens in |
Changing the line above to:
Prints out:
Printing a bit more it goes through this part of the previous code. The The NOW for the really funky part. If I insert a It seems like the However I have a hard time seeing the specific problems, it seems there is a problem when the ReaderFrom is used on a Windows file right after seek has been called on it. |
ok, digging deeper |
The commit that introduced the new behaviour: af4d604 |
@klauspost, on a whim, does it work if you reverse: + o.o.OffsetHigh = uint32(curpos)
+ o.o.Offset = uint32(curpos >> 32) And change |
Change https://golang.org/cl/130855 mentions this issue: |
@bradfitz Yes, that fixes the issue on my end (and also looks correct). |
Change https://golang.org/cl/130895 mentions this issue: |
@klauspost, thanks. I also was able to repro (with new test) and confirm the fix. CLs outstanding. |
…add test Fixes #27085 Change-Id: I4eb3ff7c76e0b8e4d8fe0298f739b0284d74a031 Reviewed-on: https://go-review.googlesource.com/130895 Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org> Reviewed-by: Andrew Bonventre <andybons@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>
Fixes golang#27085 Change-Id: I4eb3ff7c76e0b8e4d8fe0298f739b0284d74a031 Reviewed-on: https://go-review.googlesource.com/130855 Reviewed-by: Ian Lance Taylor <iant@golang.org> Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>
Change https://golang.org/cl/146797 mentions this issue: |
…add test Cherry pick of CL 130855, done manually to avoid a merge conflict on the test. Fixes #27085 Change-Id: I7c4939cf5db23253a824c46c3f00fab4edec86b4 Reviewed-on: https://go-review.googlesource.com/c/146797 Run-TryBot: Ian Lance Taylor <iant@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
What version of Go are you using (
go version
)?Go 1.11 RC1
go version go1.11rc1 windows/amd64
Does this issue reproduce with the latest release?
No, new for 1.11
What operating system and processor architecture are you using (
go env
)?What did you do?
https://download.klauspost.com/partial-content.zip
go run main.go
http://localhost:8080
(reproducible in both Chrome+Firefox)Music will stop playing after a short while.
The browser shows that while headers are returned correctly no content is sent.
Request:
Response headers:
But no content is actually sent.
What did you expect to see?
The data for the requested range to be included in the response.
What did you see instead?
0 bytes are included in the response.
The text was updated successfully, but these errors were encountered: