-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
fix(CURLRequest): multiple header sections after redirects #9426
fix(CURLRequest): multiple header sections after redirects #9426
Conversation
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.
Please add a changelog entry here: https://github.com/codeigniter4/CodeIgniter4/blob/develop/user_guide_src/source/changelogs/v4.6.1.rst under the "Bugs Fixed" section. Please follow the style from the previous changelogs.
ae7688f
to
72c5158
Compare
Change to draft as I need to add checks for |
6e2f2a6
to
4722795
Compare
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.
Looks good, thank you.
please check phpstan and rector notice |
@samsonasik Can you double check those notices please? I think I'm missing something here, they are about other files that have nothing to do with my changes. Thanks Also |
See Checks (48) on github. Run composer phpstan:baseline and vendor/bin/rector process |
5defc18
to
cc521d9
Compare
@neznaika0 @paulbalandan As for the rector notice, the file is also not part of this PR, the reported line system/HTTP/Exceptions/RedirectException.php:75 had a pass before, see Rector check with changes for 190f720 In any case, these two files are not part of this PR so I can't push fixes for them here |
Hi @ducng99 I see that the failing tests are not related to your changed files, so you can ignore that. |
Description
Fixes an issue where multiple header sections are returned if there are redirects. The original code would only parse the first header section, and treated the rest as body. For example:
With output:
$response->getBody()
returns:With these changes, the redirect header section is stripped out, only the latest header section is parsed (the 200 one in this example), and body is
Hello world
.Not sure if this issue has been discussed before but I couldn't find an issue related to this.
My machine details:
Ubuntu 24.04
PHP 8.2.27
libcurl 7.88.1
Checklist: