[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] web: http: Accept blank Content-Type headers.

From: Thompson, David
Subject: Re: [PATCH] web: http: Accept blank Content-Type headers.
Date: Mon, 27 Jul 2015 20:06:25 -0400

On Mon, Jul 27, 2015 at 5:05 PM, Mark H Weaver <address@hidden> wrote:
> David Thompson <address@hidden> writes:
>> I encountered a bug in the HTTP header parsing bug when trying to
>> download a file via Guix.  The response had a Content-Type header, but
>> with no value, like so:
>>     Content-Type:
>> From reading the W3C spec[0], an unknown Content-Type header can be
>> treated as if it were an application/octet-stream type.
> An empty string is not merely an "unknown" Content-Type header.  It is
> blatantly invalid syntax.  It would be good to contact the web site
> owner and ask them to fix it.

> Since web clients seem to accept just about anything these days, and web
> servers have adapted to this by producing garbage, it may be that we
> need to add a "permissive" mode that sifts through the garbage and uses
> heuristics to try to make some sense of it.
> However, I'm not sure it makes sense to handle this particular case of
> an empty Content-Type header specially, at that this place in the code.
> Do we have any other examples of this particular error?
> I realize that it's more work, but I would prefer to retain a mode that
> reports errors (possibly making a few compromises for very widespread
> errors), and then to somehow implement another mode that accepts
> *anything* and does its best to make sense of it.
> What do you think?
> Thanks for working on it,
>       Mark

reply via email to

[Prev in Thread] Current Thread [Next in Thread]