From 85c6b64eae0f3ca9f64a6f75b5a9ef3fc48643ea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?M=C3=A5rten=20Nordheim?= Date: Wed, 1 Dec 2021 10:06:58 +0100 Subject: qqmlxmlhttprequest: Fix h2c fallout and ignore in future The headers were hardcoded but seeing as they are ultimately ignored on the server-side (which is following the spec) we can also ignore them if they come back in some form in the future. Fixes: QTBUG-98811 Change-Id: Ida490cbd8193eb3e3bf8d56fd387af93c408d921 Reviewed-by: Fabian Kosmale Reviewed-by: Qt CI Bot (cherry picked from commit 06e68e0cc06e5c53654bf1d9fa17376317640bc8) Reviewed-by: Qt Cherry-pick Bot --- src/quicktestutils/qml/testhttpserver.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'src/quicktestutils/qml/testhttpserver.cpp') diff --git a/src/quicktestutils/qml/testhttpserver.cpp b/src/quicktestutils/qml/testhttpserver.cpp index ca574e421c..f554977468 100644 --- a/src/quicktestutils/qml/testhttpserver.cpp +++ b/src/quicktestutils/qml/testhttpserver.cpp @@ -80,6 +80,11 @@ The following request urls will then result in the appropriate action: \endtable */ +static QList ignoredHeaders = { + "HTTP2-Settings", // We ignore this + "Upgrade", // We ignore this as well +}; + static QUrl localHostUrl(quint16 port) { QUrl url; @@ -278,6 +283,12 @@ void TestHTTPServer::readyRead() break; } } + for (QByteArrayView ignore : ignoredHeaders) { + if (line.startsWith(ignore)) { + prefixFound = true; + break; + } + } if (!prefixFound && !m_waitData.headerExactMatches.contains(line)) { qWarning() << "TestHTTPServer: Unexpected header:" << line -- cgit v1.2.3