mirror of
https://github.com/d47081/qBittorrent.git
synced 2025-01-22 12:34:19 +00:00
Fix Web UI authentication with Konqueror
This commit is contained in:
parent
deffbd6321
commit
1960008c83
@ -138,6 +138,7 @@ void HttpConnection::respond() {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
QString auth = parser.value("Authorization");
|
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())) {
|
if (QString::compare(auth.split(" ").first(), "Digest", Qt::CaseInsensitive) != 0 || !parent->isAuthorized(auth.toLocal8Bit(), parser.method())) {
|
||||||
// Update failed attempt counter
|
// Update failed attempt counter
|
||||||
parent->client_failed_attempts.insert(socket->peerAddress().toString(), nb_fail+1);
|
parent->client_failed_attempts.insert(socket->peerAddress().toString(), nb_fail+1);
|
||||||
|
@ -207,7 +207,7 @@ bool HttpServer::isAuthorized(QByteArray auth, QString method) const {
|
|||||||
}
|
}
|
||||||
QByteArray prop_cnonce = regex_cnonce.cap(1).toLocal8Bit();
|
QByteArray prop_cnonce = regex_cnonce.cap(1).toLocal8Bit();
|
||||||
qDebug("prop cnonce is: %s", prop_cnonce.data());
|
qDebug("prop cnonce is: %s", prop_cnonce.data());
|
||||||
QRegExp regex_qop(".*qop=(\\w+).*");
|
QRegExp regex_qop(".*qop=[\"]?(\\w+)[\"]?.*");
|
||||||
if(regex_qop.indexIn(auth) < 0) {
|
if(regex_qop.indexIn(auth) < 0) {
|
||||||
qDebug("AUTH-PROB: missing qop");
|
qDebug("AUTH-PROB: missing qop");
|
||||||
return false;
|
return false;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user