You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@hc.apache.org by Ryan Schmitt <rs...@apache.org> on 2021/05/06 23:18:37 UTC

HTTP/2 question

Is there a way to configure the client to _not_ include a Host header in
HTTP/2 requests? Currently, my client is sending a Host header in addition
to the relevant HTTP/2 pseudo-headers (i.e. :scheme and :authority), and it
seems to be screwing up AWS request signing.

Re: HTTP/2 question

Posted by Oleg Kalnichevski <ol...@apache.org>.
On Fri, 2021-05-07 at 14:44 -0700, Ryan Schmitt wrote:
> > Can there be a custom request interceptor in the request execution
> pipeline causing the issue?
> 
> It turned out that there was code elsewhere that was manually adding
> a Host
> header, which the client was including like any other request header.
> 

Hi Ryan

Generally HttpClient does not meddle with headers added manually by the
caller, with exception of `Content-Length` and `Transfer-Encoding`
values. 

I imagine there are legitimate cases when one may want to manually set
`Host` header, for instance when working with virtual hosts.

Oleg


> On Fri, May 7, 2021 at 3:26 AM Oleg Kalnichevski <ol...@apache.org>
> wrote:
> 
> > On Thu, 2021-05-06 at 16:18 -0700, Ryan Schmitt wrote:
> > > Is there a way to configure the client to _not_ include a Host
> > > header
> > > in
> > > HTTP/2 requests? Currently, my client is sending a Host header in
> > > addition
> > > to the relevant HTTP/2 pseudo-headers (i.e. :scheme and
> > > :authority),
> > > and it
> > > seems to be screwing up AWS request signing.
> > 
> > Hi Ryan
> > 
> > The standard request interceptor never generates a `Host` header
> > for
> > HTTP/2 request messages
> > 
> > 
> > https://github.com/apache/httpcomponents-core/blob/master/httpcore5-h2/src/main/java/org/apache/hc/core5/http2/protocol/H2RequestTargetHost.java#L57
> > 
> > Can there be a custom request interceptor in the request execution
> > pipeline causing the issue?
> > 
> > cheers
> > 
> > Oleg
> > 
> > 
> > -----------------------------------------------------------------
> > ----
> > To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org
> > For additional commands, e-mail: dev-help@hc.apache.org
> > 
> > 


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


Re: HTTP/2 question

Posted by Ryan Schmitt <rs...@apache.org>.
> Can there be a custom request interceptor in the request execution
pipeline causing the issue?

It turned out that there was code elsewhere that was manually adding a Host
header, which the client was including like any other request header.

On Fri, May 7, 2021 at 3:26 AM Oleg Kalnichevski <ol...@apache.org> wrote:

> On Thu, 2021-05-06 at 16:18 -0700, Ryan Schmitt wrote:
> > Is there a way to configure the client to _not_ include a Host header
> > in
> > HTTP/2 requests? Currently, my client is sending a Host header in
> > addition
> > to the relevant HTTP/2 pseudo-headers (i.e. :scheme and :authority),
> > and it
> > seems to be screwing up AWS request signing.
>
> Hi Ryan
>
> The standard request interceptor never generates a `Host` header for
> HTTP/2 request messages
>
>
> https://github.com/apache/httpcomponents-core/blob/master/httpcore5-h2/src/main/java/org/apache/hc/core5/http2/protocol/H2RequestTargetHost.java#L57
>
> Can there be a custom request interceptor in the request execution
> pipeline causing the issue?
>
> cheers
>
> Oleg
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org
> For additional commands, e-mail: dev-help@hc.apache.org
>
>

Re: HTTP/2 question

Posted by Oleg Kalnichevski <ol...@apache.org>.
On Thu, 2021-05-06 at 16:18 -0700, Ryan Schmitt wrote:
> Is there a way to configure the client to _not_ include a Host header
> in
> HTTP/2 requests? Currently, my client is sending a Host header in
> addition
> to the relevant HTTP/2 pseudo-headers (i.e. :scheme and :authority),
> and it
> seems to be screwing up AWS request signing.

Hi Ryan

The standard request interceptor never generates a `Host` header for
HTTP/2 request messages 

https://github.com/apache/httpcomponents-core/blob/master/httpcore5-h2/src/main/java/org/apache/hc/core5/http2/protocol/H2RequestTargetHost.java#L57

Can there be a custom request interceptor in the request execution pipeline causing the issue?

cheers

Oleg


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