Browse Source

Fix Web UI authentication with Konqueror

adaptive-webui-19844
Christophe Dumez 15 years ago
parent
commit
1960008c83
  1. 1
      src/httpconnection.cpp
  2. 2
      src/httpserver.cpp

1
src/httpconnection.cpp

@ -138,6 +138,7 @@ void HttpConnection::respond() { @@ -138,6 +138,7 @@ void HttpConnection::respond() {
return;
}
QString auth = parser.value("Authorization");
qDebug("Auth: %s", auth.split(" ").first().toLocal8Bit().data());
if (QString::compare(auth.split(" ").first(), "Digest", Qt::CaseInsensitive) != 0 || !parent->isAuthorized(auth.toLocal8Bit(), parser.method())) {
// Update failed attempt counter
parent->client_failed_attempts.insert(socket->peerAddress().toString(), nb_fail+1);

2
src/httpserver.cpp

@ -207,7 +207,7 @@ bool HttpServer::isAuthorized(QByteArray auth, QString method) const { @@ -207,7 +207,7 @@ bool HttpServer::isAuthorized(QByteArray auth, QString method) const {
}
QByteArray prop_cnonce = regex_cnonce.cap(1).toLocal8Bit();
qDebug("prop cnonce is: %s", prop_cnonce.data());
QRegExp regex_qop(".*qop=(\\w+).*");
QRegExp regex_qop(".*qop=[\"]?(\\w+)[\"]?.*");
if(regex_qop.indexIn(auth) < 0) {
qDebug("AUTH-PROB: missing qop");
return false;

Loading…
Cancel
Save