Skip to content

net/http: missing flush in http.ServeContent? Go 1.19.4 #57744

Closed
@ivanjaros

Description

@ivanjaros

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:
obrázok

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    FrozenDueToAgeWaitingForInfoIssue is not actionable because of missing required information, which needs to be provided.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions