Re: [PR] Allow backwards-compatible createSocket calls [httpcomponents-client]

2024-01-16 Thread via GitHub


Sineaggi commented on PR #536:
URL: 
https://github.com/apache/httpcomponents-client/pull/536#issuecomment-1894531632

   @ok2c thanks!


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscr...@hc.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


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



Re: [PR] Allow backwards-compatible createSocket calls [httpcomponents-client]

2024-01-16 Thread via GitHub


ok2c commented on PR #536:
URL: 
https://github.com/apache/httpcomponents-client/pull/536#issuecomment-1894483150

   @Sineaggi Also cherry-picked to `5.3.x`


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscr...@hc.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


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



Re: [PR] Allow backwards-compatible createSocket calls [httpcomponents-client]

2024-01-16 Thread via GitHub


ok2c merged PR #536:
URL: https://github.com/apache/httpcomponents-client/pull/536


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscr...@hc.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


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



Re: [PR] Fixes createSocket being called with null proxy when proxy is null [httpcomponents-client]

2024-01-16 Thread via GitHub


Sineaggi commented on PR #535:
URL: 
https://github.com/apache/httpcomponents-client/pull/535#issuecomment-1894436596

   @ok2c Here's the PR https://github.com/apache/httpcomponents-client/pull/536 
with the proposed changes.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscr...@hc.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


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



[PR] Allow backwards-compatible createSocket calls [httpcomponents-client]

2024-01-16 Thread via GitHub


Sineaggi opened a new pull request, #536:
URL: https://github.com/apache/httpcomponents-client/pull/536

   In order to allow for backwards-compatibility with projects that 
override/extend the existing plain and ssl connection factories, we'll specify 
the createSocket(Proxy, HttpContext) method to call the original createSocket 
method when proxy is null.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscr...@hc.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


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



Re: [PR] Fixes createSocket being called with null proxy when proxy is null [httpcomponents-client]

2024-01-16 Thread via GitHub


ok2c commented on code in PR #535:
URL: 
https://github.com/apache/httpcomponents-client/pull/535#discussion_r1453956084


##
httpclient5/src/main/java/org/apache/hc/client5/http/socket/PlainConnectionSocketFactory.java:
##
@@ -63,7 +63,7 @@ public PlainConnectionSocketFactory() {
 
 @Override
 public Socket createSocket(final Proxy proxy, final HttpContext context) 
throws IOException {
-return proxy != null ? new Socket(proxy) : new Socket();

Review Comment:
   @Sineaggi There is no breaking change. The class remains fully API 
compatible. Any particular modality or implementation details have never been a 
part of the public contract. You abused class inheritance in your code.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscr...@hc.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


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



Re: [PR] Fixes createSocket being called with null proxy when proxy is null [httpcomponents-client]

2024-01-16 Thread via GitHub


Sineaggi commented on code in PR #535:
URL: 
https://github.com/apache/httpcomponents-client/pull/535#discussion_r1453711034


##
httpclient5/src/main/java/org/apache/hc/client5/http/socket/PlainConnectionSocketFactory.java:
##
@@ -63,7 +63,7 @@ public PlainConnectionSocketFactory() {
 
 @Override
 public Socket createSocket(final Proxy proxy, final HttpContext context) 
throws IOException {
-return proxy != null ? new Socket(proxy) : new Socket();

Review Comment:
   > The check for the proxy being non null should be performed by the method.
   
   There are two overloads of the method `createSocket` in the interface, one 
that takes a Proxy, the other one doesn't. I don't think it's obvious at first 
glance that the check for the proxy being non null should ever have to be 
performed by this method. The documentation for the method even says 
   ```
   via a proxy (generally SOCKS is expected)
   ```
   which would imply that method is called via a proxy (i.e. the proxy is 
non-null).



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscr...@hc.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


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



Re: [PR] Fixes createSocket being called with null proxy when proxy is null [httpcomponents-client]

2024-01-16 Thread via GitHub


Sineaggi commented on code in PR #535:
URL: 
https://github.com/apache/httpcomponents-client/pull/535#discussion_r1453719670


##
httpclient5/src/main/java/org/apache/hc/client5/http/socket/PlainConnectionSocketFactory.java:
##
@@ -63,7 +63,7 @@ public PlainConnectionSocketFactory() {
 
 @Override
 public Socket createSocket(final Proxy proxy, final HttpContext context) 
throws IOException {
-return proxy != null ? new Socket(proxy) : new Socket();

Review Comment:
   > one must be aware of risks of tight coupling through inheritance and risks 
of subclassing a concrete class and overriding methods that were not meant for 
extension in the first place
   
   The class in question has no private fields and no hidden internal logic, 
and has existed virtually unmodified since its creation in 2012. Without 
warning, this public and non-final class has had a breaking change made to its 
behavior in a patch release of this library.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscr...@hc.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


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



Re: [PR] Fixes createSocket being called with null proxy when proxy is null [httpcomponents-client]

2024-01-16 Thread via GitHub


ok2c commented on PR #535:
URL: 
https://github.com/apache/httpcomponents-client/pull/535#issuecomment-1894384361

   > would you be alright with modifying the existing overloads of createSocket 
in SSL and PlainConnectionFactory to call the previous createSocket method on 
null?
   
   @Sineaggi Sure, I would. Feel free to raise a PR with the proposed changes.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscr...@hc.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


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



Re: [PR] Fixes createSocket being called with null proxy when proxy is null [httpcomponents-client]

2024-01-16 Thread via GitHub


Sineaggi commented on PR #535:
URL: 
https://github.com/apache/httpcomponents-client/pull/535#issuecomment-1894157759

   If going forward the design of the connection factory class ought to use the 
new `createSocket(proxy, context)` method, for the sake of existing users of 
the library would you be alright with modifying the existing overloads of 
createSocket in SSL and PlainConnectionFactory to call the previous 
createSocket method on null?
   
   For example, like the following
   ```java
   
httpclient5/src/main/java/org/apache/hc/client5/http/ssl/SSLConnectionSocketFactory.java
   
   return proxy != null ? new Socket(proxy) : createSocket(context);
   ```


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscr...@hc.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


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



Re: [PR] Fixes createSocket being called with null proxy when proxy is null [httpcomponents-client]

2024-01-16 Thread via GitHub


Sineaggi commented on code in PR #535:
URL: 
https://github.com/apache/httpcomponents-client/pull/535#discussion_r1453719670


##
httpclient5/src/main/java/org/apache/hc/client5/http/socket/PlainConnectionSocketFactory.java:
##
@@ -63,7 +63,7 @@ public PlainConnectionSocketFactory() {
 
 @Override
 public Socket createSocket(final Proxy proxy, final HttpContext context) 
throws IOException {
-return proxy != null ? new Socket(proxy) : new Socket();

Review Comment:
   > one must be aware of risks of tight coupling through inheritance and risks 
of subclassing a concrete class and overriding methods that were not meant for 
extension in the first place
   
   The class in question has no private fields and no hidden internal logic, 
and has existed virtually unmodified since 2012. Without warning, this public 
and non-final class has had a breaking change made to its behavior in a patch 
release of this library.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscr...@hc.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


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



Re: [PR] Fixes createSocket being called with null proxy when proxy is null [httpcomponents-client]

2024-01-16 Thread via GitHub


Sineaggi commented on PR #535:
URL: 
https://github.com/apache/httpcomponents-client/pull/535#issuecomment-1894145035

   > > As it stands, there's no way for createSocket(HttpContext to be called 
anymore
   > 
   > @Sineaggi So what? This method will get removed in the next major release.
   
   Where does it say that this method will be removed? I couldn't find anything 
in the javadocs or release notes.
   
   > Individual socket factories must be able to handle `null` proxy parameters 
gracefully.
   
   Again, I couldn't find any documentation mentioning as such. Presently the 
wording would imply createSocket that doesn't take a proxy parameter would be 
called if there was no proxy.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscr...@hc.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


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



Re: [PR] Fixes createSocket being called with null proxy when proxy is null [httpcomponents-client]

2024-01-16 Thread via GitHub


Sineaggi commented on code in PR #535:
URL: 
https://github.com/apache/httpcomponents-client/pull/535#discussion_r1453711034


##
httpclient5/src/main/java/org/apache/hc/client5/http/socket/PlainConnectionSocketFactory.java:
##
@@ -63,7 +63,7 @@ public PlainConnectionSocketFactory() {
 
 @Override
 public Socket createSocket(final Proxy proxy, final HttpContext context) 
throws IOException {
-return proxy != null ? new Socket(proxy) : new Socket();

Review Comment:
   > The check for the proxy being non null should be performed by the method.
   
   There are two overloads of the method `createSocket` in the interface, one 
that takes a Proxy, the other one doesn't. I don't think it's obvious at first 
glance that the check for the proxy being non null should ever have to be 
performed by this method. The documentation for the method even says 
   ```
   via a proxy (generally SOCKS is expected)
   ```
   which would imply that method is called via a proxy.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscr...@hc.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


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



Re: [PR] Fixes createSocket being called with null proxy when proxy is null [httpcomponents-client]

2024-01-16 Thread via GitHub


ok2c closed pull request #535: Fixes createSocket being called with null proxy 
when proxy is null
URL: https://github.com/apache/httpcomponents-client/pull/535


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscr...@hc.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


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



[jira] [Commented] (HTTPASYNC-171) Async http post with apache client 5.3

2024-01-16 Thread Oleg Kalnichevski (Jira)


[ 
https://issues.apache.org/jira/browse/HTTPASYNC-171?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17807148#comment-17807148
 ] 

Oleg Kalnichevski commented on HTTPASYNC-171:
-

[~tassadar] Of course, there is.

{code:java}
final PoolingAsyncClientConnectionManager cm = 
PoolingAsyncClientConnectionManagerBuilder.create()
.setTlsConfigResolver(httphost -> TlsConfig.custom()
//.setVersionPolicy(HttpVersionPolicy.FORCE_HTTP_1)
//.setVersionPolicy(HttpVersionPolicy.FORCE_HTTP_2)
.setVersionPolicy(HttpVersionPolicy.NEGOTIATE)
.build())
.build();
try (final CloseableHttpAsyncClient client = HttpAsyncClients.custom()
.setConnectionManager(cm)
.build()) {

client.start();

final HttpHost target = new HttpHost("https", "httpbin.org");
final HttpClientContext clientContext = HttpClientContext.create();

final SimpleHttpRequest request = SimpleRequestBuilder.get()
.setHttpHost(target)
.setPath("/")
.build();

System.out.println("Executing request " + request);
final Future future = client.execute(
SimpleRequestProducer.create(request),
SimpleResponseConsumer.create(),
clientContext,
new FutureCallback() {

@Override
public void completed(final SimpleHttpResponse response) {
System.out.println(request + "->" + new StatusLine(response));
System.out.println("HTTP protocol " + 
clientContext.getProtocolVersion());
final SSLSession sslSession = clientContext.getSSLSession();
if (sslSession != null) {
System.out.println("SSL protocol " + 
sslSession.getProtocol());
System.out.println("SSL cipher suite " + 
sslSession.getCipherSuite());
}
System.out.println(response.getBody());
}

@Override
public void failed(final Exception ex) {
System.out.println(request + "->" + ex);
}

@Override
public void cancelled() {
System.out.println(request + " cancelled");
}

});
future.get();

System.out.println("Shutting down");
client.close(CloseMode.GRACEFUL);

{code}

Oleg

> Async http post with apache client 5.3
> --
>
> Key: HTTPASYNC-171
> URL: https://issues.apache.org/jira/browse/HTTPASYNC-171
> Project: HttpComponents HttpAsyncClient
>  Issue Type: Bug
>Reporter: tassadar
>Priority: Major
>
> I constructed an async client with:
> {code:java}
> private val httpclient = HttpAsyncClients.custom()
> .setConnectionManager(connectionManager)
> .build();{code}
> {color:#172b4d}And i noticed that the Content-Length header is not supplied. 
> Invastigating i saw that all the requesta were made as http 2.0, so i tried 
> to force an http 1.1 request:
> {color}
> {code:java}
> request.setVersion(HttpVersion.HTTP_1_1)
> localContext.setProtocolVersion(HttpVersion.HTTP_1_1){code}
> but it didn't worked, still the request were made as http 2.0. Trying to 
> investigate further i noticed that even if the{color:#172b4d} 
> H2RequestContent interceptor is able to manage the http 1.1 request 
> (delegating it to super) the 
> {color}AbstractH2StreamMultiplexer.{color:#172b4d}getProtocolVersion() 
> involved in the process always returns {color}http_2:
> {code:java}
> @Override
> public ProtocolVersion getProtocolVersion() {
> return HttpVersion.HTTP_2;
> }{code}
>  



--
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



[jira] [Commented] (HTTPCORE-763) Behaviour of BasicHttpRequest wrt. path is inconsistent

2024-01-16 Thread Oleg Kalnichevski (Jira)


[ 
https://issues.apache.org/jira/browse/HTTPCORE-763?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17807129#comment-17807129
 ] 

Oleg Kalnichevski commented on HTTPCORE-763:


[~turing85] I cherry-picked the change-set to 5.2.x but I cannot promise a 
release any time soon.

Oleg

> Behaviour of BasicHttpRequest wrt. path is inconsistent
> ---
>
> Key: HTTPCORE-763
> URL: https://issues.apache.org/jira/browse/HTTPCORE-763
> Project: HttpComponents HttpCore
>  Issue Type: Bug
>  Components: HttpCore
>Affects Versions: 5.1, 5.2, 5.3-alpha1
>Reporter: Marco Bungart
>Priority: Minor
> Fix For: 5.3-alpha2
>
>  Time Spent: 20m
>  Remaining Estimate: 0h
>
> The [Setter for {{path}} in 
> {{BasicHttpRequest}}|https://github.com/apache/httpcomponents-core/blob/26b3bc6d6dc56587afdb12d84361009d55a5197f/httpcore5/src/main/java/org/apache/hc/core5/http/message/BasicHttpRequest.java#L210]
>  checks whether the parameter {{path}} starts with two slashes and - if so - 
> throws an {{IllegalArgumentException}} (through the call to 
> [{{Args.check(...)}}|https://github.com/apache/httpcomponents-core/blob/26b3bc6d6dc56587afdb12d84361009d55a5197f/httpcore5/src/main/java/org/apache/hc/core5/util/Args.java#L39].
>  Similarly, method 
> [{{setUri(...)}}|https://github.com/apache/httpcomponents-core/blob/26b3bc6d6dc56587afdb12d84361009d55a5197f/httpcore5/src/main/java/org/apache/hc/core5/http/message/BasicHttpRequest.java#L264]
>  checks the raw path from tur {{URI}}.
> This leads to inconsistent behaviour. A constructor call like:
> {code:java}
> new BasicHttpRequest("GET", "http", URIAuthority.create("google.com"), 
> "//search/asdf?q=foobar");
> {code}
> works fine, while a constructor call like:
> {code:java}
> new BasicHttpRequest("GET", "http", URIAuthority.create("google.com"), 
> "doesNotMatter")
> .setPath("//search/asdf?q=foobar");
> {code}
> or
> {code:java}
> new BasicHttpRequest("GET", 
> URI.create("https://www.google.com//search/asdf?q=foobar;));
> {code}
> throws an {{{}IllegalArgumentException{}}}.
> The Class {{BasicHttpRequest}} was extended in [commit 
> {{1614d5d}}|https://github.com/apache/httpcomponents-core/commit/1614d5d5a5de6f4faadff9ecb566982d56b65179]
>  and is present since.
> I think what should happen is that the path should only be checked for {{//}} 
> if the {{authority}} is not set since [RFC 3986 in section 
> 3|https://www.rfc-editor.org/rfc/rfc3986#section-3] specifies:
> {code}
>The scheme and path components are required, though the path may be
>empty (no characters).  When authority is present, the path must
>either be empty or begin with a slash ("/") character.  When
>authority is not present, the path cannot begin with two slash
>characters ("//").
> {code}



--
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



[jira] [Commented] (HTTPCORE-763) Behaviour of BasicHttpRequest wrt. path is inconsistent

2024-01-16 Thread ASF subversion and git services (Jira)


[ 
https://issues.apache.org/jira/browse/HTTPCORE-763?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17807126#comment-17807126
 ] 

ASF subversion and git services commented on HTTPCORE-763:
--

Commit 266223192451e5d77a75329f6701701fc66fb709 in httpcomponents-core's branch 
refs/heads/5.2.x from Marco Bungart
[ https://gitbox.apache.org/repos/asf?p=httpcomponents-core.git;h=266223192 ]

HTTPCORE-763: remove checks that assert a path does not start with "//"


> Behaviour of BasicHttpRequest wrt. path is inconsistent
> ---
>
> Key: HTTPCORE-763
> URL: https://issues.apache.org/jira/browse/HTTPCORE-763
> Project: HttpComponents HttpCore
>  Issue Type: Bug
>  Components: HttpCore
>Affects Versions: 5.1, 5.2, 5.3-alpha1
>Reporter: Marco Bungart
>Priority: Minor
> Fix For: 5.3-alpha2
>
>  Time Spent: 20m
>  Remaining Estimate: 0h
>
> The [Setter for {{path}} in 
> {{BasicHttpRequest}}|https://github.com/apache/httpcomponents-core/blob/26b3bc6d6dc56587afdb12d84361009d55a5197f/httpcore5/src/main/java/org/apache/hc/core5/http/message/BasicHttpRequest.java#L210]
>  checks whether the parameter {{path}} starts with two slashes and - if so - 
> throws an {{IllegalArgumentException}} (through the call to 
> [{{Args.check(...)}}|https://github.com/apache/httpcomponents-core/blob/26b3bc6d6dc56587afdb12d84361009d55a5197f/httpcore5/src/main/java/org/apache/hc/core5/util/Args.java#L39].
>  Similarly, method 
> [{{setUri(...)}}|https://github.com/apache/httpcomponents-core/blob/26b3bc6d6dc56587afdb12d84361009d55a5197f/httpcore5/src/main/java/org/apache/hc/core5/http/message/BasicHttpRequest.java#L264]
>  checks the raw path from tur {{URI}}.
> This leads to inconsistent behaviour. A constructor call like:
> {code:java}
> new BasicHttpRequest("GET", "http", URIAuthority.create("google.com"), 
> "//search/asdf?q=foobar");
> {code}
> works fine, while a constructor call like:
> {code:java}
> new BasicHttpRequest("GET", "http", URIAuthority.create("google.com"), 
> "doesNotMatter")
> .setPath("//search/asdf?q=foobar");
> {code}
> or
> {code:java}
> new BasicHttpRequest("GET", 
> URI.create("https://www.google.com//search/asdf?q=foobar;));
> {code}
> throws an {{{}IllegalArgumentException{}}}.
> The Class {{BasicHttpRequest}} was extended in [commit 
> {{1614d5d}}|https://github.com/apache/httpcomponents-core/commit/1614d5d5a5de6f4faadff9ecb566982d56b65179]
>  and is present since.
> I think what should happen is that the path should only be checked for {{//}} 
> if the {{authority}} is not set since [RFC 3986 in section 
> 3|https://www.rfc-editor.org/rfc/rfc3986#section-3] specifies:
> {code}
>The scheme and path components are required, though the path may be
>empty (no characters).  When authority is present, the path must
>either be empty or begin with a slash ("/") character.  When
>authority is not present, the path cannot begin with two slash
>characters ("//").
> {code}



--
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



[jira] [Commented] (HTTPASYNC-171) Async http post with apache client 5.3

2024-01-16 Thread tassadar (Jira)


[ 
https://issues.apache.org/jira/browse/HTTPASYNC-171?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17807118#comment-17807118
 ] 

tassadar commented on HTTPASYNC-171:


Thanks [~olegk], so there's no way to force? Just add manually add the header i 
guess

> Async http post with apache client 5.3
> --
>
> Key: HTTPASYNC-171
> URL: https://issues.apache.org/jira/browse/HTTPASYNC-171
> Project: HttpComponents HttpAsyncClient
>  Issue Type: Bug
>Reporter: tassadar
>Priority: Major
>
> I constructed an async client with:
> {code:java}
> private val httpclient = HttpAsyncClients.custom()
> .setConnectionManager(connectionManager)
> .build();{code}
> {color:#172b4d}And i noticed that the Content-Length header is not supplied. 
> Invastigating i saw that all the requesta were made as http 2.0, so i tried 
> to force an http 1.1 request:
> {color}
> {code:java}
> request.setVersion(HttpVersion.HTTP_1_1)
> localContext.setProtocolVersion(HttpVersion.HTTP_1_1){code}
> but it didn't worked, still the request were made as http 2.0. Trying to 
> investigate further i noticed that even if the{color:#172b4d} 
> H2RequestContent interceptor is able to manage the http 1.1 request 
> (delegating it to super) the 
> {color}AbstractH2StreamMultiplexer.{color:#172b4d}getProtocolVersion() 
> involved in the process always returns {color}http_2:
> {code:java}
> @Override
> public ProtocolVersion getProtocolVersion() {
> return HttpVersion.HTTP_2;
> }{code}
>  



--
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