[PATCH] HTTP/2: copy additional headers in the pushed requests

Maxim Dounin mdounin at mdounin.ru
Fri Feb 9 15:47:48 UTC 2018


Hello!

On Thu, Feb 08, 2018 at 08:56:31PM +0000, Piotr Sikora via nginx-devel wrote:

> Hi Ruslan,
> 
> > http header: "User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_3)
> AppleWebKit/537.36 (KHTML, like Gecko) Chrome/64.0.3282.140 Safari/537.36"
> > http header: "Accept:
> text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8"
> > http header: "Accept-Encoding: gzip, deflate, br"
> > http header: "Accept-Language:
> ru,en-US;q=0.9,en;q=0.8,zh-TW;q=0.7,zh;q=0.6"
> > (...)
> > http header: "User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_3)
> AppleWebKit/537.36 (KHTML, like Gecko) Chrome/64.0.3282.140 Safari/537.36"
> > http header: "Accept: image/webp,image/apng,image/*,*/*;q=0.8"
> > http header: "Accept-Encoding: gzip, deflate, br"
> > http header: "Accept-Language:
> ru,en-US;q=0.9,en;q=0.8,zh-TW;q=0.7,zh;q=0.6"
> 
> > http header: "User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.13;
> rv:52.0) Gecko/20100101 Firefox/52.0"
> > http header: "Accept:
> text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8"
> > http header: "Accept-Language: ru-RU,ru;q=0.8,en-US;q=0.5,en;q=0.3"
> > http header: "Accept-Encoding: gzip, deflate"
> > (...)
> > http header: "User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.13;
> rv:52.0) Gecko/20100101 Firefox/52.0"
> > http header: "Accept: */*"
> > http header: "Accept-Language: ru-RU,ru;q=0.8,en-US;q=0.5,en;q=0.3"
> > http header: "Accept-Encoding: gzip, deflate"
> 
> In both examples, User-Agent, Accept-Encoding and Accept-Language are the
> same, and Accept is (an extension-specific?) subset of the "/" request,
> which proves that this is in fact a good idea.

In both examples Accept headers are different, and this can easily 
result in different responses if content negotiation is used.  I 
don't see how it proves anything but the fact that content 
negotiation should be avoided when using HTTP/2 push.

-- 
Maxim Dounin
http://mdounin.ru/


More information about the nginx-devel mailing list