-
-
Notifications
You must be signed in to change notification settings - Fork 167
Remove 'Transfer-Encoding' before emitting to the request event #137
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Remove 'Transfer-Encoding' before emitting to the request event #137
Conversation
src/Server.php
Outdated
| $stream = new LengthLimitedStream($stream, $contentLength); | ||
| } | ||
|
|
||
| $request = $request->withoutHeader('Content-Length'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added some lines to the README and changed the code. The 'Content-Length' will now only be removed if also 'Transfer-Encoding' is given.
|
Makes perfect sense now 👍 |
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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Typo: and emitted
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good eyes 👍 , fixed it.
3f1c927 to
bcfbce1
Compare
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