Skip to content

Responses to HEAD requests and certain status codes never contain a body - #156

Merged
clue merged 3 commits into
reactphp:masterfrom
clue-labs:empty-messages
Mar 31, 2017
Merged

Responses to HEAD requests and certain status codes never contain a body#156
clue merged 3 commits into
reactphp:masterfrom
clue-labs:empty-messages

Conversation

@clue

@clueclue commented Mar 30, 2017

Copy link
Copy Markdown
Member

This PR ensures we obey the HTTP specs and never send a response body for HEAD request. Similarly, certain status codes do not permit a message body.

This happens automatically, so that consumers of this lib do not have to take care of this. This also applies to our error handling logic, which now uses the same routines to ensure an invalid HEAD request does not send a response body.

See https://tools.ietf.org/html/rfc7230#section-3.3, https://tools.ietf.org/html/rfc7230#section-3.3.1 and https://tools.ietf.org/html/rfc7230#section-3.3.2

Builds on top of #152

@clue
clue merged commit 34edb9a into reactphp:masterMar 31, 2017
@clue
clue deleted the empty-messages branch March 31, 2017 07:47
@clueclue mentioned this pull request Mar 31, 2017
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

@clue@jsor@WyriHaximus