Issue with HTTP/2 communicating with GCP servers with TE: Trailers

Anirvan Sarkar powers.anirvan at gmail.com
Mon May 17 16:37:04 UTC 2021


Hi,

I think Firefox Developer Tools should not display the TE request header
value as "Trailers" since this is not a valid value as per the
specification, and it is actually sending "trailers" over the wire [1].

I have submitted a bug regarding this [2].

[1] :
https://hg.mozilla.org/mozilla-central/file/5de53d489b7d5613710a40b2c64693dbab31e8ee/netwerk/protocol/http/Http2Compression.cpp#l1167
[2] : https://bugzilla.mozilla.org/show_bug.cgi?id=1711482

On Sat, 15 May 2021 at 21:05, Jaikiran Pai <jai.forums2013 at gmail.com> wrote:

>
> On 15/05/21 5:32 pm, Jaikiran Pai wrote:
> >
> > On 15/05/21 5:13 pm, Jaikiran Pai wrote:
> >> Hello Krzysztof,
> >>
> >> On 15/05/21 1:07 am, Krzysztof K. wrote:
> >>> Hi,
> >>> I have an issue using http client communicating with servers that
> >>> most probably are on GCP (I see header: "via: 1.1 google").
> >>>
> >>> I get "java.io.IOException: Received RST_STREAM: Protocol error".
> >>> ...
> >>>
> >>> But I'm on JDK 16 (build 16+35-2229) and I get this error when
> >>> connecting to a website when I use the header "TE: Trailers" (needs
> >>> first letter capitalized).
> >>>
> >>> When I remove this header everything works, if I switch to HTTP 1.1
> >>> (with that header) it also works.
> >>>
> >>> Here is a minimal reproducible example:
> >>>
> >>> HttpClient.newBuilder()
> >>>   .build()
> >>>   .send(
> >>>     HttpRequest.newBuilder()
> >>>     .header("TE", "Trailers")
> >>
> >> IMO, this is more of an application issue than the JDK. In HTTP/2 the
> >> TE header[1] is expected to only have the value "trailers" (case
> >> sensitive) as noted here[2]. If you change your code to use
> >> "trailers" instead of "Trailers" it works (as you seem to have
> >> noticed). As for why it works in Firefox or curl, I'm not sure -
> >> perhaps they have special handling of this specific header to lower
> >> case its value if it's "Trailers"?
> >
> > A quick check of the curl source code[1] suggests that it does indeed
> > do special handling of this TE request param[2].
>
> I meant request header.
>
> -Jaikiran
>
>

-- 
Anirvan
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.java.net/pipermail/net-dev/attachments/20210518/57c4b6c2/attachment.htm>


More information about the net-dev mailing list