Skip to content

stream download via HTTPBody receives broken file on Firefox #177

@humbornjo

Description

@humbornjo

Description:

Being trying to implement connect-rpc based file upload and download service, the download behaves fine on chromium browser, but on Firefox, it only receive the first 64kb data (which is size of bufio.Writer embeded). According to the code the responseWriter won't flush until a trailer is seen. While there should exist a exception for stream HTTPBody response.

Impact:

Broken download behavior on Firefox-based browser and some cURL client (e.g. yaak). Only partial file will be downloaded.

Suggestion & Misc:

Code for Reproduce

  • Should we add a alwayFlush bool in responseWriter and set it to restHTTPBodyResponse(w.op) to treat it as a exception and always flush?
  • It confuses me that what is the root cause to the different behavior on Firefox and Chromium, I tried capture the net packets using wireshark, but found nothing.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions