summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorSamuel Gaist <samuel.gaist@idiap.ch>2018-11-20 23:31:37 +0100
committerSamuel Gaist <samuel.gaist@idiap.ch>2018-11-22 13:06:16 +0000
commitc85304484261af2fc046c909087549799a5979f9 (patch)
tree50a8ef43ba4db67722daf247f4edb036ccc72646 /tests
parentb69560d2b48d2dde568b0b7d5bf40adb21f61f95 (diff)
Use 127.0.0.1 for redirect URI
Following section 8.3 of RFC 8252 (https://tools.ietf.org/html/rfc8252#section-8.3), it is specifically not recommended to use localhost but 127.0.0.1. This patch fixes that. [ChangeLog][General] Use 127.0.0.1 in place of localhost for redirect URI following RFC 8252. Fixes: QTBUG-67528 Change-Id: I6f5a8dd26134cde2373185eaf2c8853d6f500e98 Reviewed-by: MÃ¥rten Nordheim <marten.nordheim@qt.io>
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/shared/webserver.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/tests/auto/shared/webserver.h b/tests/auto/shared/webserver.h
index 63ba001..2c27c28 100644
--- a/tests/auto/shared/webserver.h
+++ b/tests/auto/shared/webserver.h
@@ -146,7 +146,7 @@ WebServer::WebServer(Handler handler, QObject *parent) :
QUrl WebServer::url(const QString &path)
{
- const QString format("http://localhost:%1%2");
+ const QString format("http://127.0.0.1:%1%2");
return QUrl(format.arg(serverPort()).arg(path.startsWith('/') ? path : "/" + path));
}
@@ -199,7 +199,7 @@ bool WebServer::HttpRequest::readUrl(QTcpSocket *socket)
qWarning("Invalid URL path %s", fragment.constData());
return false;
}
- url.setUrl(QStringLiteral("http://localhost:") + QString::number(port) +
+ url.setUrl(QStringLiteral("http://127.0.0.1:") + QString::number(port) +
QString::fromUtf8(fragment));
state = State::ReadingStatus;
if (!url.isValid()) {