From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Thompson, David" Newsgroups: gmane.lisp.guile.devel Subject: Re: [PATCH] web: http: Accept blank Content-Type headers. Date: Mon, 27 Jul 2015 20:06:25 -0400 Message-ID: References: <87zj2m9u4r.fsf@izanagi.i-did-not-set--mail-host-address--so-tickle-me> <87y4i148gx.fsf@netris.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 X-Trace: ger.gmane.org 1438042002 14901 80.91.229.3 (28 Jul 2015 00:06:42 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 28 Jul 2015 00:06:42 +0000 (UTC) Cc: guile-devel , David Thompson To: Mark H Weaver Original-X-From: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Tue Jul 28 02:06:37 2015 Return-path: Envelope-to: guile-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1ZJsPk-0003z5-8f for guile-devel@m.gmane.org; Tue, 28 Jul 2015 02:06:36 +0200 Original-Received: from localhost ([::1]:56294 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZJsPj-0001Xf-Ai for guile-devel@m.gmane.org; Mon, 27 Jul 2015 20:06:35 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:42454) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZJsPe-0001WN-VT for guile-devel@gnu.org; Mon, 27 Jul 2015 20:06:32 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZJsPa-0008Jg-HV for guile-devel@gnu.org; Mon, 27 Jul 2015 20:06:30 -0400 Original-Received: from mail-pa0-f54.google.com ([209.85.220.54]:34020) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZJsPa-0008JW-C9 for guile-devel@gnu.org; Mon, 27 Jul 2015 20:06:26 -0400 Original-Received: by pacan13 with SMTP id an13so60303809pac.1 for ; Mon, 27 Jul 2015 17:06:25 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=h6VzZXwsi5PfLpf1cE1kD1Fou5JAetAIF0QPYQ9jugo=; b=Du6HB0xrc1KJogsgYrNv1w4zm6EpmINK7fvjBYh8qyMe3uCalBhZyJch0R9NIC4bia Icsz0rLY1I6BpEmv7Og3LSuJ/8mzoNwyqCObUsMKXEI/9xyyyJ4eT4nS6CkIWw8bsMVL upW2JKQ3sc9PqCWYvq4pNzX16ZlZYtoaq0jr3f36RLicxsa2PInF/tLNq38wUnS9uo2l pjuYtOKEcygmBHVo9YKMi8Z01Faoin71sQUGT+6TieLwxG4wg2mFLUpYLrhx9WataSHC 6tcPwU+2e/Oe71BQJ+R93UqCXAE09z+Txwbpxj3rZyL8cDs/BVZK+hmtCmYjI0zEEzew x3qw== X-Gm-Message-State: ALoCoQmAQ0Y9JbqWElEgp8so5fnjHkp6H2i+MCYTMI8lXB+x/AQ6J64zwIXCLJ47Gags9wuyEzN1 X-Received: by 10.66.141.42 with SMTP id rl10mr72969864pab.25.1438041985088; Mon, 27 Jul 2015 17:06:25 -0700 (PDT) Original-Received: by 10.70.20.164 with HTTP; Mon, 27 Jul 2015 17:06:25 -0700 (PDT) In-Reply-To: <87y4i148gx.fsf@netris.org> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.85.220.54 X-BeenThere: guile-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Developers list for Guile, the GNU extensibility library" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Original-Sender: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.lisp.guile.devel:17779 Archived-At: On Mon, Jul 27, 2015 at 5:05 PM, Mark H Weaver wrote: > David Thompson 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 >