diff options
author | Frederik Gladhorn <frederik.gladhorn@theqtcompany.com> | 2015-02-20 15:38:55 +0100 |
---|---|---|
committer | Frederik Gladhorn <frederik.gladhorn@theqtcompany.com> | 2015-02-20 15:38:55 +0100 |
commit | b797778da01f72e64cda8680f29f3fa8434ffb0a (patch) | |
tree | a917f080b40188e8f937a50b29e47898e9709a51 /tests/auto | |
parent | a834ce5889dc3a79eebe1ac0a1576603b68f5a4b (diff) | |
parent | 85a8ea105646c7d871f982b890ef5f6faa91824d (diff) | |
download | qtwebsockets-b797778da01f72e64cda8680f29f3fa8434ffb0a.tar.gz |
Merge remote-tracking branch 'origin/5.4' into 5.5
Change-Id: I96657102802860c8490c162462324e661592d879
Diffstat (limited to 'tests/auto')
-rw-r--r-- | tests/auto/handshakerequest/tst_handshakerequest.cpp | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/tests/auto/handshakerequest/tst_handshakerequest.cpp b/tests/auto/handshakerequest/tst_handshakerequest.cpp index 3e6ec40..619a477 100644 --- a/tests/auto/handshakerequest/tst_handshakerequest.cpp +++ b/tests/auto/handshakerequest/tst_handshakerequest.cpp @@ -65,6 +65,8 @@ private Q_SLOTS: void tst_multipleValuesInConnectionHeader(); void tst_multipleVersions(); + + void tst_qtbug_39355(); }; tst_HandshakeRequest::tst_HandshakeRequest() @@ -290,6 +292,26 @@ void tst_HandshakeRequest::tst_multipleVersions() QCOMPARE(request.versions().at(0), QWebSocketProtocol::Version13); } +void tst_HandshakeRequest::tst_qtbug_39355() +{ + QString header = QStringLiteral("GET /ABC/DEF/ HTTP/1.1\r\nHost: localhost:1234\r\n") + + QStringLiteral("Sec-WebSocket-Version: 13\r\n") + + QStringLiteral("Sec-WebSocket-Key: 2Wg20829/4ziWlmsUAD8Dg==\r\n") + + QStringLiteral("Upgrade: websocket\r\n") + + QStringLiteral("Connection: Upgrade\r\n\r\n"); + QByteArray data; + QTextStream textStream(&data); + QWebSocketHandshakeRequest request(8080, false); + + textStream << header; + textStream.seek(0); + request.readHandshake(textStream); + + QVERIFY(request.isValid()); + QCOMPARE(request.port(), 1234); + QCOMPARE(request.host(), QStringLiteral("localhost")); +} + QTEST_MAIN(tst_HandshakeRequest) #include "tst_handshakerequest.moc" |