-
Bug
-
Resolution: Fixed
-
P2: Important
-
6.9.1
-
None
-
bb40f641f (dev)
When using QNetworkAccessManager::sendCustomRequest(...) with an http GET request, and a non-nullptr QIODevice, then a "Content-Length: 0" header is sent, even if the data from the device is empty.
Per RFC9110, "A user agent SHOULD NOT send a Content-Length header field when the request message does not contain content and the method semantics do not anticipate such data." Semantically, HTTP_GET and HTTP_HEAD shouldn't send the header when the data is empty.
My suggestion is that the Content-Length header not be sent for GET, HEAD, DELETE, and CONNECT requests when the data body is empty EVEN if a non-null data device is passed to the call. Some CDNs and other common servers may respond differently for GET calls with "Content-Length: 0" header.
Issue encountered when using KIO::get(...) from the KDE Frameworks, in https://bugs.kde.org/show_bug.cgi?id=507523
For Gerrit Dashboard: QTBUG-138848 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
672494,1 | HTTP: don't send content-length: 0 | 6.10 | qt/qtbase | Status: NEW | +2 | 0 |