Re: Do we kill the "Host:" header in HTTP/2 ?

On Feb 1, 2013 1:50 AM, "Amos Jeffries" <squid3@treenet.co.nz> wrote:
>
> On 1/02/2013 8:09 p.m., James M Snell wrote:
>>
>> One proposal on this particular topic...
>>
>> We can combine the :scheme, :method, :host and :path header fields into
a single :req Header with a compact binary encoding and require that this
single header always appear first in request header blocks.
>>
>> +------------------------------+
>> |S|len(method)|method|len(host)|
>> +-+-------+----+---------+-----+
>> | host  | len(path) |  path  |
>> +------------------------------+
>>
>> S = Single bit, when set, scheme = https, when not set, scheme = http
>> len(method) = 7 bit length of method name
>> method = name of method
>> len(host) = uvarint(host)
>> host = host
>> len(path) = uvarint(path)
>> path = path
>>
>
> This makes several assumptions which are false and will cause a lot of
trouble:
>  1) scheme of URI is always http(s)://.

Yes, it does make this assumption. It seems, rather safe to me. What other
schemes do we need to support?

>  2) port is always the default scheme port.

No, I left this out of the examples but I assumed port would be specified
as part of host. A separate uvarint field could be used instead.

>  3) there is never a query string attached

No, I left this out of the examples but I assumed it would be sent as part
of the path.

>  4) there is never a fragment attached
>

Well, fragments currently are not passed so this is  a safe assumption, but
they would be included in the path if passed at all.

> It also ignores that abomination otherwise known as the '*' URI.
> IMHO, this is a good loss, we could require OPTIONS method on the '/' URI
with the current machines hostname or IP do the equivalent and save some
parser complexity + CPU checking the * cases on every request.

If we need it the * uri can be approximated by sending a zero length path.

- james

>
>
> Amos
>

Received on Friday, 1 February 2013 15:43:55 UTC