mirror of
https://github.com/nextcloud/desktop.git
synced 2024-10-24 05:15:40 +03:00
Merge pull request #1273 from csware/issue-1266
WebView: Properly handle usernames with spaces and plus signs in it
This commit is contained in:
commit
ea6f3be374
1 changed files with 5 additions and 3 deletions
|
@ -136,7 +136,7 @@ WebViewPageUrlSchemeHandler::WebViewPageUrlSchemeHandler(QObject *parent)
|
|||
void WebViewPageUrlSchemeHandler::requestStarted(QWebEngineUrlRequestJob *request) {
|
||||
QUrl url = request->requestUrl();
|
||||
|
||||
QString path = url.path().mid(1);
|
||||
QString path = url.path(0).mid(1); // get undecoded path
|
||||
QStringList parts = path.split("&");
|
||||
|
||||
QString server;
|
||||
|
@ -153,12 +153,14 @@ void WebViewPageUrlSchemeHandler::requestStarted(QWebEngineUrlRequestJob *reques
|
|||
}
|
||||
}
|
||||
|
||||
user = QUrl::fromPercentEncoding(user.toUtf8());
|
||||
password = QUrl::fromPercentEncoding(password.toUtf8());
|
||||
qCDebug(lcWizardWebiew()) << "Got raw user from request path: " << user;
|
||||
|
||||
user = user.replace(QChar('+'), QChar(' '));
|
||||
password = password.replace(QChar('+'), QChar(' '));
|
||||
|
||||
user = QUrl::fromPercentEncoding(user.toUtf8());
|
||||
password = QUrl::fromPercentEncoding(password.toUtf8());
|
||||
|
||||
if (!server.startsWith("http://") && !server.startsWith("https://")) {
|
||||
server = "https://" + server;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue