-
Bug
-
Resolution: Fixed
-
P2
-
9
-
b168
-
Verified
Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-8179826 | 10 | Michael McMahon | P2 | Resolved | Fixed | b07 |
The HTTP protocol version is an enum with two values for 1.1 and 2.
Currently, the protocol version can be set in either the client or then overridden in the request. If not set in the request, then the value belonging to the client is used when the request is sent, and then the HttpResponse can be queried to see which version was used.
However, what should HttpRequest.version() return if no version was specified in the builder? We don't know what value is set in the client until the request is sent via a particular client.
One possibility is to add a HTTP_UNSPECIFIED value to the version enum.
Or else HttpRequest::version() could return Optional<Version> where Optional is empty if it was not set on the request.
Currently, the protocol version can be set in either the client or then overridden in the request. If not set in the request, then the value belonging to the client is used when the request is sent, and then the HttpResponse can be queried to see which version was used.
However, what should HttpRequest.version() return if no version was specified in the builder? We don't know what value is set in the client until the request is sent via a particular client.
One possibility is to add a HTTP_UNSPECIFIED value to the version enum.
Or else HttpRequest::version() could return Optional<Version> where Optional is empty if it was not set on the request.
- backported by
-
JDK-8179826 Update default HttpClient protocol version and optional request version
-
- Resolved
-