Remove Transfer-Encoding if Content-Length is given in Response object#138
Conversation
README.md
Outdated
| (`Transfer-Encoding: chunked`) automatically. If you know the length of your | ||
| body, you MAY specify it like this instead: | ||
| (`Transfer-Encoding: chunked`) automatically. If `Transfer-Encoding` is already given | ||
| the `Content-Length` will be removed. |
There was a problem hiding this comment.
I'm undecided about this currently. Should the consumer really have control over enforcing a Transfer-Encoding? If so, are they also responsible for encoding this themselves? If not, what happens if they specify a custom encoding?
There was a problem hiding this comment.
You're right. This was already implemented but I missed the documentation about this here. I added a line in the newest commit. I hope this will enhance the documentation a bit.
There was a problem hiding this comment.
Either I'm missing something obvious here or the current implementation does not match with this documentation?!
Should the consumer really have any control over enforcing any Transfer-Encoding at all? My vote would be no, because this should be transparently handled by the server.
There was a problem hiding this comment.
With the newest commit Content-Length will always be prioritized.
There was a problem hiding this comment.
Thanks, makes much more sense like this to me 👍 The consumer never receives a Transfer-Encoding (via #137) and thus should have no control over sending one either 👍
| unset($lower[strtolower($name)]); | ||
| } | ||
| } | ||
| } |
There was a problem hiding this comment.
This is redundant with the code below, otherwise functionally LGTM 👍
There was a problem hiding this comment.
Remove the redundant loop. Checkout the latest commits.
clue
left a comment
There was a problem hiding this comment.
Nice, LGTM, but should be squashed to a reasonable number of commits 👍
2de5ee8 to
b82e8dd
Compare
|
Ping @clue . Squashed it :-) |
The Transfer-Encoding should always be removed if a Content-Length is given.
The user should never be able to set the Transfer-Encoding
Is the equivalent to #137.