-
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
Bug: CURLRequest keeps the last value provided by headers with the same name #5041
Comments
@NicolaeIotu Thank you for reporting. |
…rovided by headers with the same name CURLRequest can now get and forward all headers including multiple headers with the same name
|
I found this comment. But "return an array of header objects" is not yet implemented. CodeIgniter4/system/HTTP/MessageTrait.php Lines 120 to 121 in 0ab4d67
|
I sent PR #8240 to fix this bug. |
This will be fixed in v4.5.0. See #8240 |
It is not possible to get and forward all headers having multiple values of a response when performing a CURLRequest.
My experience was with 'set-cookie' header, but after investigating it was pretty obvious that the CURLRequest (and probably other involved or related classes) will only retain the last value of headers with the same name and in case of redirection trigger ErrorException: Header may not contain more than a single header, new line detected (SYSTEMPATH/HTTP/ResponseTrait.php at line 471).
The following fixed the issue for me:
System\HTTP\CURLRequest
System\HTTP\ResponseTrait
CodeIgniter 4 version
4.1.3
Affected module(s)
System\HTTP\CURLRequest
System\HTTP\ResponseTrait
probably some of the other classes as well
Expected behavior, and steps to reproduce if appropriate
Context
All
The text was updated successfully, but these errors were encountered: