Adding HTTP headers to HTTP protocol responses

Mike Hommey mh at glandium.org
Fri May 6 09:41:19 EDT 2016


On Fri, May 06, 2016 at 09:46:56PM +0900, Mike Hommey wrote:
> Hi,
> 
> I've been looking at the wire protocol recently and found two things,
> one that is wrong and one that is suboptimal, in the HTTP protocol.
> 
> The first is that the HTTP client sends a Vary header when it uses HTTP
> headers to convey the protocol parameters. But Vary is not an HTTP
> request header. It is a *response* header.
> [ https://tools.ietf.org/html/rfc2616#section-14.44 ]
> 
> Whether it's worth setting is questionable. Arguably, it should be
> Vary: *. Or even Cache-control: no-cache.
> [ https://tools.ietf.org/html/rfc2616#section-14.9 ]
> 
> The second is that the response to a getbundle request is a chunked (per
> https://tools.ietf.org/html/rfc2616#section-3.6.1 ) raw zlib stream. But
> it's not marked as such with a Content-Encoding header (with the value
> "deflate").

Note that another valid way to indicate it is to add ", deflate" to the
Transfer-Encoding response header.

Mike


More information about the Mercurial-devel mailing list