You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by bu...@apache.org on 2018/12/13 15:58:51 UTC

[Bug 63009] New: Content-Length header is dropped when HTTP2 is used

https://bz.apache.org/bugzilla/show_bug.cgi?id=63009

            Bug ID: 63009
           Summary: Content-Length header is dropped when HTTP2 is used
           Product: Tomcat 9
           Version: 9.0.13
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Catalina
          Assignee: dev@tomcat.apache.org
          Reporter: boris_petrov@live.com
  Target Milestone: -----

The Content-Length header is set and sent correctly when using HTTP1.1 (over
plain-text HTTP or over HTTPS) both for static files and when our own code sets
it on the response.

However, when making a request using HTTP2 (over TLS), that header is not sent
neither for static files, nor from our code.

I can't see a reason for this and would guess that this is a bug in Tomcat. Or
am I missing something?

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


[Bug 63009] Content-Length header is dropped when HTTP2 is used

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=63009

--- Comment #1 from Mark Thomas <ma...@apache.org> ---
Sending the content-length header is optional in HTTP/2. See section 8.1.2.6 of
RFC 7540:
"A request or response that includes a payload body can include a
content-length header field."

The header is not required since HTTP/2 includes sufficient information in the
frame headers for a user agent to determine when a resource has been sent in
full.

What providing the content-length header does do is give the user agent advance
notice of how big the resource is. That may be useful information (e.g. large
resources cached straight to disk, small ones in memory).

I think it makes sense to send the content-length if it has been set or can be
determined (essentially do what we do for HTTP1/1). Note that if the
content-length header and the actual content-length disagree it will be treated
as a protocol error for that stream.

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


Re: [Bug 63009] Content-Length header is dropped when HTTP2 is used

Posted by Christopher Schultz <ch...@christopherschultz.net>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

All,

On 12/14/18 17:05, Caldarale, Charles R wrote:
>> From: Christopher Schultz [mailto:chris@christopherschultz.net] 
>> Subject: Re: [Bug 63009] Content-Length header is dropped when
>> HTTP2 is
> used
> 
>> Is this bad enough to pull and re-roll the latest 8.5.x release? 
>> Missing Content-Type is ... pretty bad.
> 
> The fix was for a missing (and optional) Content-Length, not
> Content-Type. Or did I miss something?

That was a typo. I had intended to say that "Content-Length" was
important.

- -chris
-----BEGIN PGP SIGNATURE-----
Comment: Using GnuPG with Thunderbird - https://www.enigmail.net/

iQIzBAEBCAAdFiEEMmKgYcQvxMe7tcJcHPApP6U8pFgFAlwWq4QACgkQHPApP6U8
pFjfog//SuRb314u5LA86pQO+TGqd/ZPH60QidOWOSIG2XQ0ATcmp7dT4Dy83hMe
GRA4BhzGkcr1i0dUh6L1g9MPkikB861XNdqZbPAHXELYqdioamCz7DIusIROqu8U
vbFRvxWI52HTlewEyZbyI7pjpfNPaSxJgQhBOAPNwjlSUz4uJ+cCWZ3ydkhMc4RZ
0ME0GjeJflHGwDvD2U/9aEfhyeh/tw32NtSILGgpEA2C8tMSUrL5YPzZZV5zNexb
FHX+j+BX0oB+TYlGBcaj61WECVJrAcuUUVqOvisgYUUbvuztAqadkynF9CeY4UlQ
3W+6LD1GhsVMvRHjDWbvIJjOdYkcWQcCm8RsyLCBHQS2F9xb1Rju0NNVoOpo8mEq
U+ufUigc7kB40yx8Fjd7twuAJI8EKHexIRMOSG4aPCKI/Jst+svZZ7n6C79TbhXj
VJ9b9kYzTM7aITJeAxGUn5dhBG+KYBhR0CEqYqaRL81hCoy7i8NCLw2UuOSvG8TF
L59E/gGtNjoKjUHs8NElsk5alJMPfGdSLuodR2YYQnm7W8bZrfB2SsSvjTPUT0Ds
5J80bxHYuqh3W/2lehHJ8Lqr47nOgiSnk28CUIQltylsix+9gONKvMomTRzqrtv4
0tiyunuafgsiXjcVBMhEdAkm6hd6UGEY3pTqBOTLjCbeDFYmF7I=
=icab
-----END PGP SIGNATURE-----

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


Re: [Bug 63009] Content-Length header is dropped when HTTP2 is used

Posted by Rémy Maucherat <re...@apache.org>.
On Sat, Dec 15, 2018 at 9:13 PM Mark Thomas <ma...@apache.org> wrote:

> > So ... I wanted to add I have nothing against the add even if it is
> > optional (like reason phrase !!!! :) ), since hpack should make that
> > addition as efficient as possible.
>
> Fair point.
>
> I did consider rejecting the bug but a little googling identified a
> number of reasons to provide the content-length including providing
> download progress information and more efficient caching.
>
> I guess it could be made configurable but I'm not sure that is worth the
> effort.
>

I'm 100% ok with it, no need for config.

Rémy

Re: [Bug 63009] Content-Length header is dropped when HTTP2 is used

Posted by Mark Thomas <ma...@apache.org>.
On 14/12/2018 22:30, Rémy Maucherat wrote:
> On Fri, Dec 14, 2018 at 11:05 PM Caldarale, Charles R <
> Chuck.Caldarale@unisys.com> wrote:
> 
>>> From: Christopher Schultz [mailto:chris@christopherschultz.net]
>>> Subject: Re: [Bug 63009] Content-Length header is dropped when HTTP2 is
>> used
>>
>>> Is this bad enough to pull and re-roll the latest 8.5.x release?
>>> Missing Content-Type is ... pretty bad.
>>
>> The fix was for a missing (and optional) Content-Length, not Content-Type.
>> Or did I miss something?
>>
> 
> Yes no panic, Chris probably misread the title.
> 
> So ... I wanted to add I have nothing against the add even if it is
> optional (like reason phrase !!!! :) ), since hpack should make that
> addition as efficient as possible.

Fair point.

I did consider rejecting the bug but a little googling identified a
number of reasons to provide the content-length including providing
download progress information and more efficient caching.

I guess it could be made configurable but I'm not sure that is worth the
effort.

Mark

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


Re: [Bug 63009] Content-Length header is dropped when HTTP2 is used

Posted by Rémy Maucherat <re...@apache.org>.
On Fri, Dec 14, 2018 at 11:05 PM Caldarale, Charles R <
Chuck.Caldarale@unisys.com> wrote:

> > From: Christopher Schultz [mailto:chris@christopherschultz.net]
> > Subject: Re: [Bug 63009] Content-Length header is dropped when HTTP2 is
> used
>
> > Is this bad enough to pull and re-roll the latest 8.5.x release?
> > Missing Content-Type is ... pretty bad.
>
> The fix was for a missing (and optional) Content-Length, not Content-Type.
> Or did I miss something?
>

Yes no panic, Chris probably misread the title.

So ... I wanted to add I have nothing against the add even if it is
optional (like reason phrase !!!! :) ), since hpack should make that
addition as efficient as possible.

Rémy

RE: [Bug 63009] Content-Length header is dropped when HTTP2 is used

Posted by "Caldarale, Charles R" <Ch...@unisys.com>.
> From: Christopher Schultz [mailto:chris@christopherschultz.net] 
> Subject: Re: [Bug 63009] Content-Length header is dropped when HTTP2 is
used

> Is this bad enough to pull and re-roll the latest 8.5.x release?
> Missing Content-Type is ... pretty bad.

The fix was for a missing (and optional) Content-Length, not Content-Type.
Or did I miss something?

  - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY
MATERIAL and is thus for use only by the intended recipient. If you received
this in error, please contact the sender and delete the e-mail and its
attachments from all computers.


Re: [Bug 63009] Content-Length header is dropped when HTTP2 is used

Posted by Christopher Schultz <ch...@christopherschultz.net>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

All,

Is this bad enough to pull and re-roll the latest 8.5.x release?
Missing Content-Type is ... pretty bad.

- -chris

On 12/14/18 12:39, bugzilla@apache.org wrote:
> https://bz.apache.org/bugzilla/show_bug.cgi?id=63009
> 
> Mark Thomas <ma...@apache.org> changed:
> 
> What    |Removed                     |Added 
> ----------------------------------------------------------------------
- ------
>
> 
Status|NEW                         |RESOLVED
> Resolution|---                         |FIXED
> 
> --- Comment #2 from Mark Thomas <ma...@apache.org> --- Fixed in: -
> trunk for 9.0.15 onwards - 8.5.x for 8.5.38 onwards
> 
-----BEGIN PGP SIGNATURE-----
Comment: Using GnuPG with Thunderbird - https://www.enigmail.net/

iQIzBAEBCAAdFiEEMmKgYcQvxMe7tcJcHPApP6U8pFgFAlwUJykACgkQHPApP6U8
pFiVkw//TNhDegEyMjyRcGN/r1Bx1U7+5coE8k6/5QHStsDmCziDrWIpiA+CWZ1M
xquSTkE/lnb8jBZbKBQmJloLk3G4IEtN4FJ7Gqu94kObI/MBAwr9ekem/oStB02z
li7GuVtkicWIGzTCeV6A9wvnwZ7D38AFq0wIepUzYj14EH4/I9iPkk4PnHDE14Hl
XC3nUp9Lr2MNv/3KhYKRmgfcKeSwwEEAjx8M1K5uJsUrkiAH1IrwySEnGXiW043t
SaOpGUCi/JPC8/NgJLmB2AW95JIkVY35BioKhF4lNPrFytxPC4sUvLUp3AtsyF5T
uw+XGJpSInfiDY4NAZSZZ2bDjWIA/TPESoX7DojuwcY8bMVUuRZi5IdOyJ0TZJ2w
1YHN/bl85TxXMOBaHSNdzC2luDDnMXKlTgYY7RsQX+elvI4J3DdaMtJaP6RC17PN
36Br+p63dx+YzFeJ2eUA0bISNoLjdTIqv71IVqUsyxVnTeyFuzVy0pCaXNsyEkvW
UBYoTr3P0MS1X5zGlJ4dy0USYIexrY9V6wjkKTKtLUXfjSl+RHTn2bEUNR+bONfE
pKjnSrzSYXNj02RjTQT0Q+G3eIuSkGEMlQYMAzMPmN22tt3YOzuYJpPwPMgduKnI
unBcJHJ5WslU7Yd/cfl0pYEUR5vzaz4oXCQvT3XKzAVzGFgbdb0=
=qLtd
-----END PGP SIGNATURE-----

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


[Bug 63009] Content-Length header is dropped when HTTP2 is used

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=63009

Mark Thomas <ma...@apache.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|---                         |FIXED

--- Comment #2 from Mark Thomas <ma...@apache.org> ---
Fixed in:
- trunk for 9.0.15 onwards
- 8.5.x for 8.5.38 onwards

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org