Remove 'Transfer-Encoding' before emitting to the request event#137
Merged
WyriHaximus merged 3 commits intoreactphp:masterfrom Mar 7, 2017
Merged
Remove 'Transfer-Encoding' before emitting to the request event#137WyriHaximus merged 3 commits intoreactphp:masterfrom
WyriHaximus merged 3 commits intoreactphp:masterfrom
Conversation
clue
requested changes
Mar 3, 2017
src/Server.php
Outdated
| $stream = new LengthLimitedStream($stream, $contentLength); | ||
| } | ||
|
|
||
| $request = $request->withoutHeader('Content-Length'); |
Member
There was a problem hiding this comment.
What is the point in always removing this? Isn't this something (for example) a middleware might be interested in?
Also, I don't see this documented anywhere, in particular not the WHY?
Contributor
Author
There was a problem hiding this comment.
Added some lines to the README and changed the code. The 'Content-Length' will now only be removed if also 'Transfer-Encoding' is given.
clue
approved these changes
Mar 3, 2017
Member
|
Makes perfect sense now 👍 |
jsor
reviewed
Mar 4, 2017
README.md
Outdated
|
|
||
| The `Request` class is responsible for streaming the incoming request body | ||
| and contains meta data which was parsed from the request headers. | ||
| If the request body is chunked-encoded, the data will be decoded an emitted on the data event. |
Contributor
Author
There was a problem hiding this comment.
Good eyes 👍 , fixed it.
3f1c927 to
bcfbce1
Compare
clue
approved these changes
Mar 6, 2017
jsor
approved these changes
Mar 6, 2017
WyriHaximus
approved these changes
Mar 7, 2017
This was referenced Apr 6, 2018
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 the complete header will be emitted to the request event. The request event will always receive decoded data. So at this point there is no need to keep the header lines.
Builds on top of #116