[ 
https://issues.apache.org/jira/browse/HTTPCLIENT-2362?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17927288#comment-17927288
 ] 

Oleg Kalnichevski commented on HTTPCLIENT-2362:
-----------------------------------------------

[~pavlov112] 
 # The latest revision of the HTTP/1.1 specification mandates endpoints to 
always signal the highest protocol version with the same major version they are 
capable of supporting. HttpClient supports HTTP/1.1 and therefore always 
signals that in the request line of request messages it generates.
 # HttpClient always tries to respect the protocol version set at the request 
level as a hint. When executing requests with HTTP/1.0 hint HttpClient will use 
HTTP/1.0 compatible semantic only though the protocol version in the request 
line will still be signaled as HTTP/1.1
 # One can still force HttpClient into a HTTP/1.0 only mode by doing this

{code:java}
HttpClientBuilder.create()
        .setConnectionManager(PoolingHttpClientConnectionManagerBuilder.create()
                
.setConnectionFactory(ManagedHttpClientConnectionFactory.builder()
                        .http1Config(Http1Config.custom()
                                .setVersion(HttpVersion.HTTP_1_0)
                                .build())
                        .build())
                .build());

{code}
Oleg

> Regression: Versions after 5.3.1 silently ignore attempts to perform HTTP/1.0 
> requests
> --------------------------------------------------------------------------------------
>
>                 Key: HTTPCLIENT-2362
>                 URL: https://issues.apache.org/jira/browse/HTTPCLIENT-2362
>             Project: HttpComponents HttpClient
>          Issue Type: Bug
>    Affects Versions: 5.4-alpha1, 5.4-alpha2, 5.4, 5.4.1, 5.4.2
>            Reporter: Matthew E. Dawson
>            Priority: Major
>
> Every attempt I've made to use the classic API to invoke an HTTP/1.0 request 
> is silently converted into HTTP/1.1:
> {code:java}
> final var request = new HttpGet(uri);
> request.setVersion(HttpVersion.HTTP_1_0);
> client.execute(host, request, responseHandler);
> {code}
> There's no error on the client side, but everything that I see on the server 
> side shows HTTP/1.1, whether I use the classic or async interfaces. I've 
> drilled down into the source and I think that it's because 
> DefaultHttpRequestWriter entirely ignores the request's version in favor of 
> that returned by its internal config object (which always points back at 
> HttpVersion.HTTP_1_1), which would more properly make this a core defect 
> rather than client, but I have no idea if the problem is confined to the core 
> library.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@hc.apache.org
For additional commands, e-mail: dev-h...@hc.apache.org

Reply via email to