Skip to content

Content Length not deleted on HTML rewrite if HTML Only #56

@mmartinsky

Description

@mmartinsky
      /* Sniff out the content-type header.
       * If the response is HTML, we're safe to modify it.
       */
      if (!_htmlOnly && res.isHtml()) {
        res.removeHeader('Content-Length');
        delete headers['content-length'];
      }

If I have an HTML response, but I'm targeted to HTML only, the content length won't get overwritten, which leads to
"Error: Transferred a partial file" errors on the response.

Why is this guarded by !_htmlOnly?

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