-
Bug
-
Resolution: Fixed
-
P2: Important
-
6.9.1
-
None
-
-
cdd0b0b86 (dev), 1d8184465 (6.10)
When making a request over HTTP/2 that returns an error status code (e.g. 500), QNetworkReply::errorString() produces output like:
Error transferring https://api.example.com/ - server replied:
The message template assumes that a reason phrase is present. However, HTTP/2 and HTTP/3 do not carry a reason phrase (RFC 7540 §8.1.2.4), so the field is always empty. This leaves a confusing dangling "server replied:" with nothing after it.
Steps to Reproduce
- Create a simple QNetworkAccessManager GET request to an endpoint that returns HTTP/2 500 with no body.
- Connect to the finished() signal and call reply->errorString()
- Observe that the string ends with "server replied: " and nothing else.
Expected Result
errorString() should omit the "server replied:" part if the reason phrase is empty, or use a neutral fallback such as "server returned status 500".
Actual Result
Output contains "server replied:" with nothing after it.
For Gerrit Dashboard: QTBUG-140126 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
676302,2 | Http: Improve error string when there is no reason phrase | dev | qt/qtbase | Status: MERGED | +2 | 0 |
676744,2 | Http: Improve error string when there is no reason phrase | 6.10 | qt/qtbase | Status: MERGED | +2 | 0 |
676864,1 | Http: Improve error string when there is no reason phrase | 6.9 | qt/qtbase | Status: STAGED | +2 | 0 |