Description
I have updated my go to the latest version 1.19.4, I think from previous 1.19.3, and I have noticed that when files go over certain size(small test sample suggest this) the http.ServeContent will fail to serve them properly. Specifically, images will be missing ending and will look like this:
and firefox will return Image corrupt or truncated.
. PDF files will also fail to load. So it is universal issue. I have verified with io.Copy() instead of http.ServeContent that the file is correct. So the bug is in the http.ServeContent and it feels like there is some buffering/flushing issue, specifically because smaller images are fine but i think 64k is the line where above it the files will be corrupt. In the release notes there are couple of mentions of http package so it's almost certain there was a bug introduced as part of a fix of something else.
ps: go1.19.4 windows/amd64