-
Notifications
You must be signed in to change notification settings - Fork 183
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Allow no SP after status-code for HTTP/1.x responses (#2247)
Motivation: While RFC7230, section 3.1.2 (https://datatracker.ietf.org/doc/html/rfc7230#section-3.1.2) requires a `SP` before a `reason-phrase`, even if it's an empty phrase, many implementations don't include that `SP` character. Many clients parse a response without trailing `SP` character with no error. Those implementations are: - Apache HTTP Client - JDK HttpClient - Netty - Tomcat (https://bz.apache.org/bugzilla/show_bug.cgi?id=60362) - Go HttpClient (golang/go@d71d08a#diff-0e6945dfde3e4dcaba7cfd394a85328b8137c42e152b4486dbfb6756ad69a779R145-R146) - Rust HttpClient (hyperium/http#345) - httpd with Passenger (https://bugzilla.redhat.com/show_bug.cgi?id=1032733) Moreover, neither HTTP/2 nor HTTP/3 support reason-phrase. For this reasons, many HTTP/1.x implementations (Tomcat, Rust, etc.) decided to drop including the reason-phrase in serialized response for performance reasons. Instead, they use the reason-phrase defined by RFC for all known status codes and use `Unknown` for non-standard status codes. Modifications: - `HttpObjectDecoder`: second `SP` is optional for `HttpResponseDecoder`; - Enhance tests to verify new behavior; Result: ServiceTalk HttpClient parses responses with no `SP` after status code. Example: `HTTP/1.1 200\r\n`.
- Loading branch information
1 parent
1f6e4ba
commit d05e52a
Showing
4 changed files
with
45 additions
and
14 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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