Details
-
Bug
-
Resolution: Fixed
-
P2: Important
-
None
-
6.7.0 Beta1
-
None
Description
Here is my test code:
#include <QCoreApplication> #include <QNetworkAccessManager> #include <QNetworkRequest> #include <QNetworkReply> #include <QUrl> QNetworkAccessManager *g_Manager = nullptr; void post(); int main(int argc, char *argv[]) { QCoreApplication a(argc, argv); QNetworkAccessManager manager; g_Manager = &manager; post(); post(); return a.exec(); } void post() { QEventLoop eventLoop; QObject::connect(g_Manager, &QNetworkAccessManager::finished, &eventLoop, &QEventLoop::quit); QNetworkRequest request(QUrl("http://localhost/api/test")); request.setHeader(QNetworkRequest::ContentTypeHeader, "application/json"); QNetworkReply *reply = g_Manager->post(request, "{}"); eventLoop.exec(); reply->deleteLater(); }
First request have no Content-Type header.
Patch 6.6.1 using the fix from QTBUG-109396 can also reproduce this.