@@ -158,7 +158,7 @@ bool ESP8266WebServer::_parseRequest(WiFiClient& client) {
158
158
DEBUG_OUTPUT.println (headerValue);
159
159
#endif
160
160
161
- if (headerName == " Content-Type" ){
161
+ if (headerName. equalsIgnoreCase ( " Content-Type" ) ){
162
162
if (headerValue.startsWith (" text/plain" )){
163
163
isForm = false ;
164
164
} else if (headerValue.startsWith (" application/x-www-form-urlencoded" )){
@@ -168,9 +168,9 @@ bool ESP8266WebServer::_parseRequest(WiFiClient& client) {
168
168
boundaryStr = headerValue.substring (headerValue.indexOf (' =' )+1 );
169
169
isForm = true ;
170
170
}
171
- } else if (headerName == " Content-Length" ){
171
+ } else if (headerName. equalsIgnoreCase ( " Content-Length" ) ){
172
172
contentLength = headerValue.toInt ();
173
- } else if (headerName == " Host" ){
173
+ } else if (headerName. equalsIgnoreCase ( " Host" ) ){
174
174
_hostHeader = headerValue;
175
175
}
176
176
}
@@ -237,7 +237,7 @@ bool ESP8266WebServer::_parseRequest(WiFiClient& client) {
237
237
DEBUG_OUTPUT.println (headerValue);
238
238
#endif
239
239
240
- if (headerName == " Host" ){
240
+ if (headerName. equalsIgnoreCase ( " Host" ) ){
241
241
_hostHeader = headerValue;
242
242
}
243
243
}
@@ -257,7 +257,7 @@ bool ESP8266WebServer::_parseRequest(WiFiClient& client) {
257
257
258
258
bool ESP8266WebServer::_collectHeader (const char * headerName, const char * headerValue) {
259
259
for (int i = 0 ; i < _headerKeysCount; i++) {
260
- if (_currentHeaders[i].key == headerName) {
260
+ if (_currentHeaders[i].key . equalsIgnoreCase ( headerName) ) {
261
261
_currentHeaders[i].value =headerValue;
262
262
return true ;
263
263
}
@@ -389,7 +389,7 @@ bool ESP8266WebServer::_parseForm(WiFiClient& client, String boundary, uint32_t
389
389
390
390
line = client.readStringUntil (' \r ' );
391
391
client.readStringUntil (' \n ' );
392
- if (line.startsWith (" Content-Disposition" )){
392
+ if (line.length () > 19 && line. substring ( 0 , 19 ). equalsIgnoreCase (" Content-Disposition" )){
393
393
int nameStart = line.indexOf (' =' );
394
394
if (nameStart != -1 ){
395
395
argName = line.substring (nameStart+2 );
@@ -414,7 +414,7 @@ bool ESP8266WebServer::_parseForm(WiFiClient& client, String boundary, uint32_t
414
414
argType = " text/plain" ;
415
415
line = client.readStringUntil (' \r ' );
416
416
client.readStringUntil (' \n ' );
417
- if (line.startsWith (" Content-Type" )){
417
+ if (line.length () > 12 && line. substring ( 0 , 12 ). equalsIgnoreCase (" Content-Type" )){
418
418
argType = line.substring (line.indexOf (' :' )+2 );
419
419
// skip next line
420
420
client.readStringUntil (' \r ' );
0 commit comments