-
Notifications
You must be signed in to change notification settings - Fork 9.4k
Update Curl to respect case-insensitive headers #29274
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
Update Curl to respect case-insensitive headers #29274
Conversation
According to RFC 2616 header names are case-insensitive: "Each header field consists of a name followed by a colon (":") and the field value. Field names are case-insensitive." - see https://tools.ietf.org/html/rfc2616#section-4.2 The "Set-Cookie" comparison in the previous version is case-sensitive and can cause problems with some (rare) HTTP servers.
Hi @pmzandbergen. Thank you for your contribution
❗ Automated tests can be triggered manually with an appropriate comment:
You can find more information about the builds here ℹ️ Please run only needed test builds instead of all when developing. Please run all test builds before sending your PR for review. For more details, please, review the Magento Contributor Guide documentation. 🕙 You can find the schedule on the Magento Community Calendar page. 📞 The triage of Pull Requests happens in the queue order. If you want to speed up the delivery of your contribution, please join the Community Contributions Triage session to discuss the appropriate ticket. 🎥 You can find the recording of the previous Community Contributions Triage on the Magento Youtube Channel ✏️ Feel free to post questions/proposals/feedback related to the Community Contributions Triage process to the corresponding Slack Channel |
Hi @pmzandbergen. |
@rogyar tried to do so yesterday but the site gave a SSL error. Seems to be fixed, checking the CLA now. |
Hi @pmzandbergen, thank you for your contribution! |
Hi @pmzandbergen. Thank you for your contribution
❗ Automated tests can be triggered manually with an appropriate comment:
You can find more information about the builds here ℹ️ Please run only needed test builds instead of all when developing. Please run all test builds before sending your PR for review. For more details, please, review the Magento Contributor Guide documentation. |
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.
In general looks good. Would be good to have strict comparison and cover your change with some kind of test, for instance unit test.
Could you update your PR accordingly?
@magento run all tests |
Co-authored-by: Ihor Sviziev <[email protected]>
Done
There are no existing tests for the cookie handling of the client. Adding tests for the cookie handling in general would be nice.
Done. |
I'll add tests next Friday. |
…ndbergen/magento2 into patch-1 � Conflicts: � lib/internal/Magento/Framework/HTTP/Client/Curl.php
@ihor-sviziev added tests. Unfortunately the cUrl class needs to be extended for this test to allow mocking of the curl_exec function since it calls the protected |
Unfortunately there are only 24 hours in a day ;-) It's on my TODO list, updates will follow. |
Tests updated, removed the Curl mock and added tests using the reflection method instead. |
@magento run all tests |
Failed tests are not related to the PR changes |
Hi @sidolov, thank you for the review. |
@pmzandbergen thank you for contributing. Please accept Community Contributors team invitation here to gain extended permissions for this repository. |
Hi @ihor-sviziev, thank you for the review. |
Hi @pmzandbergen, thank you for your contribution! |
According to RFC 2616 header names are case-insensitive: "Each header field consists of a name followed by a colon (":") and the field value. Field names are case-insensitive." - see https://tools.ietf.org/html/rfc2616#section-4.2
The "Set-Cookie" comparison in the current Curl client is case-sensitive and can cause problems with some (rare) HTTP servers.
Description (*)
According to RFC 2616 header names are case-insensitive: "Each header field consists of a name followed by a colon (":") and the field value. Field names are case-insensitive." - see https://tools.ietf.org/html/rfc2616#section-4.2
The "Set-Cookie" comparison in the previous version is case-sensitive and can cause problems with some (rare) HTTP servers.
Related Pull Requests
None
Fixed Issues (if relevant)
Did not create an issue
Manual testing scenarios (*)
Questions or comments
Please note that I did not provide a unit test for this specific issue. If required please let me know.
Contribution checklist (*)
Resolved issues: