Re: [Technical Errata Reported] RFC7230 (4189)

Zhong Yu <zhong.j.yu@gmail.com> Tue, 21 April 2015 15:52 UTC

Return-Path: <ietf-http-wg-request+bounce-httpbisa-archive-bis2juki=lists.ie@listhub.w3.org>
X-Original-To: ietfarch-httpbisa-archive-bis2Juki@ietfa.amsl.com
Delivered-To: ietfarch-httpbisa-archive-bis2Juki@ietfa.amsl.com
Received: from localhost (ietfa.amsl.com [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 0AE5F1ACEF3 for <ietfarch-httpbisa-archive-bis2Juki@ietfa.amsl.com>; Tue, 21 Apr 2015 08:52:54 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -7.012
X-Spam-Level:
X-Spam-Status: No, score=-7.012 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, RCVD_IN_DNSWL_HI=-5, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001, T_RP_MATCHES_RCVD=-0.01] autolearn=ham
Received: from mail.ietf.org ([4.31.198.44]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id bkbZ55DPdeXU for <ietfarch-httpbisa-archive-bis2Juki@ietfa.amsl.com>; Tue, 21 Apr 2015 08:52:53 -0700 (PDT)
Received: from frink.w3.org (frink.w3.org [128.30.52.56]) (using TLSv1.2 with cipher DHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 00DAB1ACEED for <httpbisa-archive-bis2Juki@lists.ietf.org>; Tue, 21 Apr 2015 08:52:52 -0700 (PDT)
Received: from lists by frink.w3.org with local (Exim 4.80) (envelope-from <ietf-http-wg-request@listhub.w3.org>) id 1YkaQO-00057Y-Nq for ietf-http-wg-dist@listhub.w3.org; Tue, 21 Apr 2015 15:49:24 +0000
Resent-Date: Tue, 21 Apr 2015 15:49:24 +0000
Resent-Message-Id: <E1YkaQO-00057Y-Nq@frink.w3.org>
Received: from maggie.w3.org ([128.30.52.39]) by frink.w3.org with esmtp (Exim 4.80) (envelope-from <zhong.j.yu@gmail.com>) id 1YkaQK-00056c-26 for ietf-http-wg@listhub.w3.org; Tue, 21 Apr 2015 15:49:20 +0000
Received: from mail-oi0-f53.google.com ([209.85.218.53]) by maggie.w3.org with esmtps (TLS1.2:RSA_ARCFOUR_SHA1:128) (Exim 4.80) (envelope-from <zhong.j.yu@gmail.com>) id 1YkaQJ-00030x-D4 for ietf-http-wg@w3.org; Tue, 21 Apr 2015 15:49:20 +0000
Received: by oift201 with SMTP id t201so157583049oif.3 for <ietf-http-wg@w3.org>; Tue, 21 Apr 2015 08:48:53 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=LzCzB5z6OaIgb36fnbU60Lb5+QfSevdv4Qraw55Ikxk=; b=k9DTqzqjjclKFl9DankSSm1+JPjbvmjCwHhogzjwpoxpcAJKrLJIIxZ7T246VcrOX0 KVuJmmlAw+fJy0csO12fv+NuRZF95tvC0xmKU7725ixwT7d5v6/Rj0870Rs1UNlhkWqK VCPzMoYHj2yRsjyTL5T3LfdSKO/Z6WwM0viZGkNXUsnU8DM2F7ppgPjUEHr0tIhpPsdl 0E2BywV4f/vYub+ebk8zxA1Lwq1hfBT6961VizVma9/zP/nVtPGOLI3jCz8HqMwMhqnB 8OSkBPhQDCmG/iGwEJr160CfFobHUORJQgjpgZ6Te0pk/XZYRyh50xSWyo9/Se9zDm19 iETw==
MIME-Version: 1.0
X-Received: by 10.182.91.4 with SMTP id ca4mr19566039obb.39.1429631333516; Tue, 21 Apr 2015 08:48:53 -0700 (PDT)
Received: by 10.76.72.34 with HTTP; Tue, 21 Apr 2015 08:48:53 -0700 (PDT)
In-Reply-To: <CACuKZqEUtPmph1QFgS8HAOvnxtpYm7eBNra9TwCCrOuNy0xGTg@mail.gmail.com>
References: <20141126195639.B3D5C181CE7@rfc-editor.org> <5476D0BC.70905@greenbytes.de> <CALaySJJh-9w2mnT9fV9dxaOJ_Tq=ipvV7nbNbEqY+g_6ppJjTg@mail.gmail.com> <723A86CD-6369-4A8A-B277-CBDA4439DCE9@gbiv.com> <55364CFE.1000007@gmx.de> <CACuKZqEUtPmph1QFgS8HAOvnxtpYm7eBNra9TwCCrOuNy0xGTg@mail.gmail.com>
Date: Tue, 21 Apr 2015 10:48:53 -0500
Message-ID: <CACuKZqGNbBkJTWJSATGE8DB_ewp853L+47fdduWLE3DtJWROgA@mail.gmail.com>
From: Zhong Yu <zhong.j.yu@gmail.com>
To: Julian Reschke <julian.reschke@gmx.de>
Cc: "Roy T. Fielding" <fielding@gbiv.com>, Barry Leiba <barryleiba@computer.org>, RFC Errata System <rfc-editor@rfc-editor.org>, Pete Resnick <presnick@qti.qualcomm.com>, Mark Nottingham <mnot@mnot.net>, Simon Schüppel <simon.schueppel@googlemail.com>, HTTP Working Group <ietf-http-wg@w3.org>
Content-Type: text/plain; charset="UTF-8"
Received-SPF: pass client-ip=209.85.218.53; envelope-from=zhong.j.yu@gmail.com; helo=mail-oi0-f53.google.com
X-W3C-Hub-Spam-Status: No, score=-4.5
X-W3C-Hub-Spam-Report: AWL=-1.686, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_LOW=-0.7, SPF_PASS=-0.001, W3C_AA=-1, W3C_WL=-1
X-W3C-Scan-Sig: maggie.w3.org 1YkaQJ-00030x-D4 f7b3c5627d8c8cb39074044437906cd6
X-Original-To: ietf-http-wg@w3.org
Subject: Re: [Technical Errata Reported] RFC7230 (4189)
Archived-At: <http://www.w3.org/mid/CACuKZqGNbBkJTWJSATGE8DB_ewp853L+47fdduWLE3DtJWROgA@mail.gmail.com>
Resent-From: ietf-http-wg@w3.org
X-Mailing-List: <ietf-http-wg@w3.org> archive/latest/29363
X-Loop: ietf-http-wg@w3.org
Resent-Sender: ietf-http-wg-request@w3.org
Precedence: list
List-Id: <ietf-http-wg.w3.org>
List-Help: <http://www.w3.org/Mail/>
List-Post: <mailto:ietf-http-wg@w3.org>
List-Unsubscribe: <mailto:ietf-http-wg-request@w3.org?subject=unsubscribe>

I'll suggest the following fix:

     header-field   = field-name ":" OWS field-value OWS

     field-name     = token
*    field-value    = [ field-content  *( obs-fold field-content ) ]
*    field-content  = field-vchar [ *( SP / HTAB / field-vchar ) field-vchar ]
     field-vchar    = VCHAR / obs-text

*    obs-fold       = OWS CRLF 1*( SP / HTAB )


"field-content" spans a whole line, without leading/trailing spaces,
and contains at least one visible char.

This will force message producers to apply folding reasonably.

And if by using this stricter grammar, a message parser rejects a
production that was previously accepted, it might not be a bad thing
either - the production is practically ambiguous and invites different
interpretations.

Zhong



On Tue, Apr 21, 2015 at 10:24 AM, Zhong Yu <zhong.j.yu@gmail.com> wrote:
> Another question about obs-fold before we proceed with the formal
> definitions. Consider the following example
>
> foo: bar<CRLF>
> <SP><CRLF>
> ...
>
> It won't be surprising if some parser mistakes the 2nd line as an
> "empty line" that terminates the headers. Visually it *is* an empty
> line.
>
> In spirit, obs-fold should be followed by visible chars, otherwise
> it's very confusing and problematic.
>
> RFC 822 $3.2 appears to suggest the same thing, that obs-fold can only
> appear between two non-empty segments.
>
>
> Zhong