8000 Support for concatenation of headers by sophienyaa · Pull Request #4864 · esp8266/Arduino · GitHub
[go: up one dir, main page]

Skip to content

Support for concatenation of headers #4864

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

Merged
merged 5 commits into from
Oct 4, 2018
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Use commas and only when needed
Change ";" to "," to match the HTTP specs.

Add ",<nextval>" on each additional value instead of adding a
comma automatically after every value, even single ones.
  • Loading branch information
earlephilhower authored Oct 3, 2018
commit 387a5144af7852256e52fedb11fad385e3b47a51
9 changes: 7 additions & 2 deletions libraries/ESP8266HTTPClient/src/ESP8266HTTPClient.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1041,8 +1041,13 @@ int HTTPClient::handleHeaderResponse()

for(size_t i = 0; i < _headerKeysCount; i++) {
if(_currentHeaders[i].key.equalsIgnoreCase(headerName)) {
_currentHeaders[i].value += headerValue + ";";
break;
if (_currentHeaders[i].value != "") {
// Existing value, append this one with a comma
_currentHeaders[i].value += "," + headerValue;
} else {
_currentHeaders[i].value = headerValue;
}
break; // We found a match, stop looking
}
}
}
Expand Down
0