Fix Content-Length for POST when data empty#78
Open
rouja wants to merge 1 commit intolaminas:2.19.xfrom
Open
Conversation
Ocramius
requested changes
Oct 3, 2023
| } | ||
| else { | ||
| if ($this->getMethod() == 'POST') { | ||
| $headers['Content-Length'] = 0; |
Member
There was a problem hiding this comment.
What about PUT, PATCH, etc.?
Also, this kind of change must be accompanied with a test.
Author
There was a problem hiding this comment.
Hi,
I'm not a developer but I can try to improve this PR. Do you have a procedure to run phpunit test locally ?
Member
There was a problem hiding this comment.
Hey,
You can do this locally, if you have php and composer installed:
git clone <this-repo>
composer install
./vendor/bin/phpunit
Author
There was a problem hiding this comment.
Hello,
I had a test.
For PUT, PATCH and others, I'm not sure what to do...
7c243d1 to
d0d8e23
Compare
6a8695e to
167f4cd
Compare
Signed-off-by: Jacques ROUSSEL <jacques.roussel@rouaje.com>
167f4cd to
d16ce47
Compare
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.
Description
The RFC7230 says :
Some load balancers reject empty POST without a Content-Lenght set to 0 with an HTTP 411 error. For instance Google Global Load Balancers does.