-
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 extra headers #5218
Fix CURLRequest extra headers #5218
Conversation
The code looks good but I would like it if someone else with more CURL experience took a look. |
P.S. In my opinion, better solution auto calculate dynamic/generic headers before sending request. List of headers to import better than |
$header = str_replace('_', ' ', strtolower($header)); | ||
$header = str_replace(' ', '-', ucwords($header)); | ||
|
||
if (in_array($header, $this->unsharedHeaders, true)) { |
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.
$header = str_replace('_', '-', strtolower($header));
$titleHeader = ucwords($header, '-');
...
$this->headerMap[$header] = $titleHeader;
@WinterSilence Thank you for your comment!
Why? What is it? CI4 does not have it now.
Why do you need them?
It is just because they are not considered yet. This PR only fixes the issue #4826.
Yeah, it is good design. But the current implementation is the opposite. After all, I don't understand this class well enough to be able to create a list of headers to share. |
@kenjis you can add my polyfill or ralouphie/getallheaders
because you can't auto detect all dynamic/generic headers to remove |
If you reset it at the beginning of the request(), you will not be able to use setForm().
6832cd5
to
4b51e01
Compare
If they are in $unsharedHeaders are removed in the top of |
Do you have the header list that you want to import? |
@kenjis nope, it's my ugly English... You want use "allow all, deny $unsharedHeaders" list, I vote to use "deny all, allow $sharedHeaders" list. We need save only "cookie" and "auth" headers, other headers should be specified by the user himself. |
I sent another PR: #5249 |
Is there any use case? |
@kenjis Sorry, I miss link to my polyfill. Polyfill must be similar to original |
Description
Fixes #4826
Checklist: