Skip to content

Commit

Permalink
httpClient: prevent empty user-agent in header (#8411)
Browse files Browse the repository at this point in the history
  • Loading branch information
d-a-v authored Jan 3, 2022
1 parent e5a214e commit e3c79de
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions libraries/ESP8266HTTPClient/src/ESP8266HTTPClient.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -929,8 +929,10 @@ bool HTTPClient::sendHeader(const char * type)
header += ':';
header += String(_port);
}
header += F("\r\nUser-Agent: ");
header += _userAgent;
if (_userAgent.length()) {
header += F("\r\nUser-Agent: ");
header += _userAgent;
}

if (!_useHTTP10) {
header += F("\r\nAccept-Encoding: identity;q=1,chunked;q=0.1,*;q=0");
Expand Down

0 comments on commit e3c79de

Please sign in to comment.