Skip to content

write() getting called before writeHead() on gzip'd content causes failures #49

@kaysond

Description

@kaysond

It seems like harmon depends on the assumption that writeHead() gets called before write()

For whatever reason, there are situations where res.writeHead() doesn't get called until after one (or all!) res.write() calls.

So if the content is gzipped, then harmon doesn't set res.isGziped until after some of the data has already been written to the output, and either the gzip'd content gets sent to the output, or gzip fails because it gets only part of the data.

A possible solution would be to check content encoding on the first write() call, and store that.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions