diff options
| author | MÃ¥rten Nordheim <marten.nordheim@qt.io> | 2021-12-01 10:06:58 +0100 |
|---|---|---|
| committer | Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> | 2021-12-03 13:55:40 +0000 |
| commit | 85c6b64eae0f3ca9f64a6f75b5a9ef3fc48643ea (patch) | |
| tree | 26988704e56722a83d1a30a29e7c7defb6cce820 /src/quicktestutils/qml/testhttpserver.cpp | |
| parent | cb8b50193f53ea56304abf14aba5da6a563f5016 (diff) | |
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 <fabian.kosmale@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
(cherry picked from commit 06e68e0cc06e5c53654bf1d9fa17376317640bc8)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Diffstat (limited to 'src/quicktestutils/qml/testhttpserver.cpp')
| -rw-r--r-- | src/quicktestutils/qml/testhttpserver.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
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<QByteArrayView> 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 |
