summaryrefslogtreecommitdiffstats
path: root/src/network/access/qhttpprotocolhandler.cpp
diff options
context:
space:
mode:
authorMate Barany <mate.barany@qt.io>2024-02-01 16:00:42 +0100
committerJuha Vuolle <juha.vuolle@qt.io>2024-02-06 19:10:45 +0200
commitbb34c6fa6bcedc4d7ed2383caad3ad435d77e1ff (patch)
tree34a09974591ea801c9f710a2b17c31dcf1bc7884 /src/network/access/qhttpprotocolhandler.cpp
parent7fa6d09ca20b27b8350e6e26040372ba70e6244d (diff)
Make QNAM handle all informational HTTP replies
Make QNetworkAccessManager to discard all informational (1xx) replies from HTTP servers with the exception of 101. According to RFC 9110: "A client MUST be able to parse one or more 1xx responses received prior to a final response, even if the client does not expect one. A user agent MAY ignore unexpected 1xx responses." Status code 101 is an exception because we use it to upgrade to http2 cleartext when it is enabled. Fixes: QTBUG-108068 Change-Id: I415ff053180a43f0c7ff1b4b2a60fd114ce08ac9 Reviewed-by: MÃ¥rten Nordheim <marten.nordheim@qt.io> Reviewed-by: Juha Vuolle <juha.vuolle@qt.io>
Diffstat (limited to 'src/network/access/qhttpprotocolhandler.cpp')
-rw-r--r--src/network/access/qhttpprotocolhandler.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/network/access/qhttpprotocolhandler.cpp b/src/network/access/qhttpprotocolhandler.cpp
index 19dfc9b164..28eab03890 100644
--- a/src/network/access/qhttpprotocolhandler.cpp
+++ b/src/network/access/qhttpprotocolhandler.cpp
@@ -93,7 +93,8 @@ void QHttpProtocolHandler::_q_receiveReply()
} else {
replyPrivate->autoDecompress = false;
}
- if (m_reply->statusCode() == 100) {
+ const int statusCode = m_reply->statusCode();
+ if (statusCode == 100 || (102 <= statusCode && statusCode <= 199)) {
replyPrivate->clearHttpLayerInformation();
replyPrivate->state = QHttpNetworkReplyPrivate::ReadingStatusState;
break; // ignore