fix: RFC-compliant HTTP reason phrases in QtHttpReply#1510
Merged
awawa-dev merged 1 commit intoawawa-dev:masterfrom Apr 12, 2026
Merged
fix: RFC-compliant HTTP reason phrases in QtHttpReply#1510awawa-dev merged 1 commit intoawawa-dev:masterfrom
awawa-dev merged 1 commit intoawawa-dev:masterfrom
Conversation
Remove punctuation from status reason phrases (OK., Bad request !, etc.) to comply with RFC 7230 §3.1.2. Non-standard phrases caused Caddy and other reverse proxies to drop response bodies.
Owner
|
It seems both |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
QtHttpReply::getStatusTextForCodereturns reason phrases with non-standard punctuation:OK.OKBad request !Bad RequestForbidden !ForbiddenNot found !Not FoundRFC 7230 §3.1.2 defines the status line as
HTTP-version SP status-code SP reason-phrase CRLF. Reason phrases with punctuation like trailing periods and exclamation marks cause strict HTTP parsers to treat the response as malformed. Concretely, Caddy'sreverse_proxydirective returns a zero-length body to the client when it receives these non-standard status lines.The fix normalises all four phrases to the IANA-registered strings.
What kind of change does this PR introduce?
Does this PR introduce a breaking change?
Other information:
Verified end-to-end: built from source in Docker, confirmed
ncprobe returnsHTTP/1.1 200 OK(no trailing period), and Caddyreverse_proxynow forwards non-empty response bodies.