-
Notifications
You must be signed in to change notification settings - Fork 7.6k
Multible http response headers with the same name get overwritten #4069
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
Comments
Make an edit right at that page and in the pull request mention @Jeroen88 |
I just took a quick review of the code. I am not in favor of this change:
A real solution would involve quite some adaptations and very likely an API change, since requestArgument (not a very good name because in this context it is used as a responseArgument) needs to accommodate an array or vector of values. This implies changes in the functions for accessing the values as well. |
[STALE_SET] This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 14 days if no further activity occurs. Thank you for your contributions. |
why not implement like on the esp8266? |
[STALE_CLR] This issue has been removed from the stale queue. Please ensure activity to keep it openin the future. |
[STALE_SET] This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 14 days if no further activity occurs. Thank you for your contributions. |
[STALE_DEL] This stale issue has been automatically closed. Thank you for your contributions. |
* Support concatenation of headers (as in esp8266/Arduino@1de0c34#diff-977435a9cc4619fa0b8b995085f6ae683485cf563722756bab57108b362da316 for ESP8266, fixes #4069) * Add support for receiving, storing and sending cookies (cookie jar) * Cookie support: Respect `secure` attribute when sending a request * Fix missing `_secure` flag * Comment out support concatenation of headers (not needed anymore when using cookie jar)
* Support concatenation of headers (as in esp8266/Arduino@1de0c34#diff-977435a9cc4619fa0b8b995085f6ae683485cf563722756bab57108b362da316 for ESP8266, fixes espressif#4069) * Add support for receiving, storing and sending cookies (cookie jar) * Cookie support: Respect `secure` attribute when sending a request * Fix missing `_secure` flag * Comment out support concatenation of headers (not needed anymore when using cookie jar) Co-authored-by: Matthias Dreher <[email protected]>
If the http client gets multible headers with the same name in the response (for example set-cookie headers), they get overwritten. My way to fix it was to change
arduino-esp32/libraries/HTTPClient/src/HTTPClient.cpp
Line 1149 in b92c58d
to
if(_currentHeaders[i].key.equalsIgnoreCase(headerName) && _currentHeaders[i].value.length() == 0) {
to check if the header value is not set to avoid overwriting when saving multible headers with the same name
The text was updated successfully, but these errors were encountered: