Skip to content
This repository has been archived by the owner on Apr 22, 2023. It is now read-only.

Properly respond to HTTP HEAD requests during end(body) hot path #1291

Closed
wants to merge 5 commits into from

Conversation

reid
Copy link

@reid reid commented Jul 8, 2011

During write(), _hasBody is checked to make sure a body is allowed -- this is now also checked during end(body)'s hot path when write() isn't used.

Without this patch, it's possible that res.end("foo") can send a malformed HEAD response that http_parser rejects.

Includes a new test.

reid added 5 commits July 7, 2011 21:04
During write(), _hasBody is checked to make sure a body
is allowed -- this is now also checked during end(body)
when write() isn't used.
Instead of simply clearing data, check _hasBody
earlier to avoid sending cruft when chunkedEncoding
is used.
@koichik koichik closed this in 973153d Jul 19, 2011
@koichik
Copy link

koichik commented Jul 19, 2011

I squashed these commits into a single commit.
Thanks!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants