Skip to content

Commit dcdc62a

Browse files
committed
Put longer string literals into PROGMEM
1 parent fb2cbe3 commit dcdc62a

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

libraries/ESP8266HTTPClient/src/ESP8266HTTPClient.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -113,8 +113,8 @@ class BearSSLTraits : public TransportTraits
113113
* constructor
114114
*/
115115
HTTPClient::HTTPClient()
116+
: _client(nullptr), _userAgent(F("ESP8266HTTPClient"))
116117
{
117-
_client = nullptr;
118118
#if HTTPCLIENT_1_1_COMPATIBLE
119119
_tcpDeprecated.reset(nullptr);
120120
#endif
@@ -1294,21 +1294,21 @@ int HTTPClient::handleHeaderResponse()
12941294
String headerValue = headerLine.substring(headerLine.indexOf(':') + 1);
12951295
headerValue.trim();
12961296

1297-
if(headerName.equalsIgnoreCase("Content-Length")) {
1297+
if(headerName.equalsIgnoreCase(F("Content-Length"))) {
12981298
_size = headerValue.toInt();
12991299
}
13001300

1301-
if(_canReuse && headerName.equalsIgnoreCase("Connection")) {
1301+
if(_canReuse && headerName.equalsIgnoreCase(F("Connection"))) {
13021302
if(headerValue.indexOf("close") >= 0 && headerValue.indexOf("keep-alive") < 0) {
13031303
_canReuse = false;
13041304
}
13051305
}
13061306

1307-
if(headerName.equalsIgnoreCase("Transfer-Encoding")) {
1307+
if(headerName.equalsIgnoreCase(F("Transfer-Encoding"))) {
13081308
transferEncoding = headerValue;
13091309
}
13101310

1311-
if(headerName.equalsIgnoreCase("Location")) {
1311+
if(headerName.equalsIgnoreCase(F("Location"))) {
13121312
_location = headerValue;
13131313
}
13141314

@@ -1334,7 +1334,7 @@ int HTTPClient::handleHeaderResponse()
13341334

13351335
if(transferEncoding.length() > 0) {
13361336
DEBUG_HTTPCLIENT("[HTTP-Client][handleHeaderResponse] Transfer-Encoding: %s\n", transferEncoding.c_str());
1337-
if(transferEncoding.equalsIgnoreCase("chunked")) {
1337+
if(transferEncoding.equalsIgnoreCase(F("chunked"))) {
13381338
_transferEncoding = HTTPC_TE_CHUNKED;
13391339
} else {
13401340
return HTTPC_ERROR_ENCODING;

libraries/ESP8266HTTPClient/src/ESP8266HTTPClient.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -242,7 +242,7 @@ class HTTPClient
242242
String _uri;
243243
String _protocol;
244244
String _headers;
245-
String _userAgent = "ESP8266HTTPClient";
245+
String _userAgent;
246246
String _base64Authorization;
247247

248248
/// Response handling

libraries/ESP8266WebServer/src/Parsing-impl.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,7 @@ bool ESP8266WebServerTemplate<ServerType>::_parseRequest(ClientType& client) {
238238
DEBUG_OUTPUT.println(headerValue);
239239
#endif
240240

241-
if (headerName.equalsIgnoreCase("Host")){
241+
if (headerName.equalsIgnoreCase(F("Host"))){
242242
_hostHeader = headerValue;
243243
}
244244
}

0 commit comments

Comments
 (0)