Only allow chunked encoding on request#140
Merged
WyriHaximus merged 1 commit intoreactphp:masterfrom Mar 7, 2017
Merged
Conversation
clue
requested changes
Mar 6, 2017
README.md
Outdated
| If the request body is chunked-encoded, the data will be decoded and emitted on the data event. | ||
| The `Transfer-Encoding` header will be removed. | ||
|
|
||
| Any other `Transfer-Encoding` than `chunked` will result in an error message. |
Member
There was a problem hiding this comment.
Not sure there this should be placed. "will result in an error message" where is this raised? See also chapter above?
Contributor
Author
There was a problem hiding this comment.
I put this into the right place now, I think. Have a look
src/Server.php
Outdated
|
|
||
| if (strtolower($request->getHeaderLine('Transfer-Encoding')) !== 'chunked') { | ||
| $this->emit('error', array(new \InvalidArgumentException('Only chunked-encoding is allowed for Transfer-Encoding'))); | ||
| return $this->writeError($conn, 400); |
Member
There was a problem hiding this comment.
Why 400?
https://tools.ietf.org/html/rfc7230#section-3.3.1 seems to suggest otherwise:
A server that receives a request message with a transfer coding it
does not understand SHOULD respond with 501 (Not Implemented).
Contributor
Author
There was a problem hiding this comment.
Changed it. Have look.
c621828 to
7796d26
Compare
jsor
approved these changes
Mar 6, 2017
WyriHaximus
approved these changes
Mar 7, 2017
Member
WyriHaximus
left a comment
There was a problem hiding this comment.
@legionth LGTM, could you resolve merge conflicts?
7796d26 to
8eb88ba
Compare
Contributor
Author
|
Ping @WyriHaximus . Resolved the merge conflicts. |
Member
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Currently only chunked-encoding is supported, so the server should only allow
chunkedinTransfer-Encoding.Built on top of #137 (so this should be merged first :-))