summaryrefslogtreecommitdiff
path: root/tests/auto/websockets/qwebsocket/tst_qwebsocket.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tests/auto/websockets/qwebsocket/tst_qwebsocket.cpp')
-rw-r--r--tests/auto/websockets/qwebsocket/tst_qwebsocket.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/tests/auto/websockets/qwebsocket/tst_qwebsocket.cpp b/tests/auto/websockets/qwebsocket/tst_qwebsocket.cpp
index f993f84..789d1fa 100644
--- a/tests/auto/websockets/qwebsocket/tst_qwebsocket.cpp
+++ b/tests/auto/websockets/qwebsocket/tst_qwebsocket.cpp
@@ -424,7 +424,9 @@ void tst_QWebSocket::tst_sendTextMessage()
QUrl url = QUrl(QStringLiteral("ws://") + echoServer.hostAddress().toString() +
QStringLiteral(":") + QString::number(echoServer.port()));
url.setPath("/segment/with spaces");
- url.addQueryItem("queryitem", "with encoded characters");
+ QUrlQuery query;
+ query.addQueryItem("queryitem", "with encoded characters");
+ url.setQuery(query);
socket.open(url);
@@ -588,7 +590,9 @@ void tst_QWebSocket::tst_openRequest()
QUrl url = QUrl(QStringLiteral("ws://") + echoServer.hostAddress().toString() +
QLatin1Char(':') + QString::number(echoServer.port()));
- url.addQueryItem("queryitem", "with encoded characters");
+ QUrlQuery query;
+ query.addQueryItem("queryitem", "with encoded characters");
+ url.setQuery(query);
QNetworkRequest req(url);
req.setRawHeader("X-Custom-Header", "A custom header");
socket.open(req);