diff --git a/src/network/access/qnetworkaccessmanager.cpp b/src/network/access/qnetworkaccessmanager.cpp index f059fc15afb..b424b2f6720 100644 --- a/src/network/access/qnetworkaccessmanager.cpp +++ b/src/network/access/qnetworkaccessmanager.cpp @@ -796,7 +796,7 @@ QNetworkReply *QNetworkAccessManager::get(const QNetworkRequest &request) \note A GET request with a message body is not cached. \note If the request is redirected, the message body will be kept only if the status code is - 307 or 308. + 308. */ QNetworkReply *QNetworkAccessManager::get(const QNetworkRequest &request, QIODevice *data) @@ -814,7 +814,7 @@ QNetworkReply *QNetworkAccessManager::get(const QNetworkRequest &request, QIODev \note A GET request with a message body is not cached. \note If the request is redirected, the message body will be kept only if the status code is - 307 or 308. + 308. */ QNetworkReply *QNetworkAccessManager::get(const QNetworkRequest &request, const QByteArray &data) diff --git a/src/network/access/qnetworkreplyhttpimpl.cpp b/src/network/access/qnetworkreplyhttpimpl.cpp index 53b93fead66..5a0cd052782 100644 --- a/src/network/access/qnetworkreplyhttpimpl.cpp +++ b/src/network/access/qnetworkreplyhttpimpl.cpp @@ -1260,10 +1260,10 @@ void QNetworkReplyHttpImplPrivate::onRedirected(const QUrl &redirectUrl, int htt return; } - // If the original operation was a GET with a body and the status code is either - // 307 or 308 then keep the message body + // If the original operation was a GET with a body and the status code is + // 308 then keep the message body const bool getOperationKeepsBody = (operation == QNetworkAccessManager::GetOperation) - && (httpStatus == 307 || httpStatus == 308); + && httpStatus == 308; redirectRequest = createRedirectRequest(originalRequest, url, maxRedirectsRemaining); operation = getRedirectOperation(operation, httpStatus); diff --git a/tests/auto/network/access/qnetworkreply/tst_qnetworkreply.cpp b/tests/auto/network/access/qnetworkreply/tst_qnetworkreply.cpp index d7318ba56b3..a3a8aaad7f5 100644 --- a/tests/auto/network/access/qnetworkreply/tst_qnetworkreply.cpp +++ b/tests/auto/network/access/qnetworkreply/tst_qnetworkreply.cpp @@ -2310,7 +2310,7 @@ void tst_QNetworkReply::getWithBodyRedirected() QVERIFY(validateRedirectedResponseHeaders(reply)); // Verify that the message body has arrived to the server - if (status > 302) { + if (status > 307) { QVERIFY(server2.contentLength != 0); QCOMPARE(server2.contentLength, dataFromClientToServer.size()); QCOMPARE(server2.receivedData.right(dataFromClientToServer.size()), dataFromClientToServer);