diff --git a/libraries/WebServer/src/WebServer.cpp b/libraries/WebServer/src/WebServer.cpp index 027d2464..9b29f3e2 100644 --- a/libraries/WebServer/src/WebServer.cpp +++ b/libraries/WebServer/src/WebServer.cpp @@ -33,7 +33,8 @@ static const char AUTHORIZATION_HEADER[] = "Authorization"; -static const char qop_auth[] = "qop=\"auth\""; +static const char qop_auth[] PROGMEM = "qop=auth"; +static const char qop_auth_quoted[] PROGMEM = "qop=\"auth\""; static const char WWW_Authenticate[] = "WWW-Authenticate"; static const char Content_Length[] = "Content-Length"; @@ -185,7 +186,7 @@ bool WebServer::authenticate(const char * username, const char * password){ } // parameters for the RFC 2617 newer Digest String _nc,_cnonce; - if(authReq.indexOf(FPSTR(qop_auth)) != -1) { + if(authReq.indexOf(FPSTR(qop_auth)) != -1 || authReq.indexOf(FPSTR(qop_auth_quoted)) != -1) { _nc = _extractParam(authReq, F("nc="), ','); _cnonce = _extractParam(authReq, F("cnonce=\""),'\"'); } @@ -205,7 +206,7 @@ bool WebServer::authenticate(const char * username, const char * password){ } log_v("Hash of GET:uri=%s", _H2.c_str()); String _responsecheck = ""; - if(authReq.indexOf(FPSTR(qop_auth)) != -1) { + if(authReq.indexOf(FPSTR(qop_auth)) != -1 || authReq.indexOf(FPSTR(qop_auth_quoted)) != -1) { _responsecheck = md5str(_H1 + ':' + _nonce + ':' + _nc + ':' + _cnonce + F(":auth:") + _H2); } else { _responsecheck = md5str(_H1 + ':' + _nonce + ':' + _H2);