[apps-discuss] Question about RFC 7239

"luigipinca@libero.it" <luigipinca@libero.it> Sun, 28 August 2016 19:50 UTC

Return-Path: <luigipinca@libero.it>
X-Original-To: apps-discuss@ietfa.amsl.com
Delivered-To: apps-discuss@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 2E0BB12D0BF for <apps-discuss@ietfa.amsl.com>; Sun, 28 Aug 2016 12:50:09 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.72
X-Spam-Level:
X-Spam-Status: No, score=-2.72 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, FREEMAIL_FROM=0.001, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001] autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (2048-bit key) header.d=libero.it
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 5gg3HHuTdNkY for <apps-discuss@ietfa.amsl.com>; Sun, 28 Aug 2016 12:50:08 -0700 (PDT)
Received: from libero.it (smtp-17.italiaonline.it [212.48.25.145]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 1D7EA12D0B9 for <apps-discuss@ietf.org>; Sun, 28 Aug 2016 12:50:07 -0700 (PDT)
Received: from webmail-56.iol.local ([10.255.25.82]) by smtp-17.iol.local with SMTP id e65ib7s86681se65ibM1g4; Sun, 28 Aug 2016 21:50:04 +0200
x-libjamoibt: 1601
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=libero.it; s=s2014; t=1472413804; bh=0uv/QxbxP2DwlPrfWbJudcrxeIHgzc27+A+2cKOlpjQ=; h=Date:From:Reply-To:To:Subject; b=t4rqvr9q4O8r68ONeFMAj+jj/lSpHkj8k7F9glRMrrXfql2pskB1VSXIRLtEJMczp se/pmEjX4Ap2fddEike8FRkxLtQXzIhGqaLDGVC3JVIAy6oDSuYXLu6ZRc6EY3vtrc 0yJu4XVH3lDTH9AmwLoS6exO9w0A3XYyXACACO71+Y/28/y1hKq00xUpEwFfZFpCYb G3o21w1XJBHA8K0Weq8PiRa+U8oA7VCCz6173nsDbzefDThYUGbu/yXvDsi1dkq4fC Ldr+1Lr0xubq5mQ/cD0tBiiLF94MJqmqKlFHIq4lGuhJ5RFsZ2F7uKErQHvAVR4iZI leQfrJ3qoRCEg==
X-CNFS-Analysis: v=2.2 cv=LYJ+0XXi c=1 sm=1 tr=0 a=I52joOGmR5L7+fovlJZwvw==:117 a=8D6cX0wMWuUA:10 a=Pfsz1xswR3AA:10 a=x1-6zHxI9d0A:10 a=lVOGhCD4rhh26ZCd9gMA:9 a=QEXdDO2ut3YA:10 a=LPZK7dhTGsBBbkBzCOwA:9 a=hTsGOhNDyr3sUnsx:21
Message-ID: <2119936850.4077721472413802214.JavaMail.httpd@webmail-56.iol.local>
Date: Sun, 28 Aug 2016 21:50:02 +0200
From: "luigipinca@libero.it" <luigipinca@libero.it>
To: apps-discuss@ietf.org
MIME-Version: 1.0
Content-Type: multipart/alternative; boundary="----=_Part_467635_1541709415.1472413802213"
X-SenderIP: 212.124.190.235
X-libjamv: 8K7rGF1D6ps=
X-libjamsun: 2whkkypcNv/zAaENk02754RXGVm5ZhgE
X-CMAE-Envelope: MS4wfERbc739o3Kmtbcpz1/MKn1AKyct1WjqoGJeVuHjRdz4B9BKKXcjrk/yPSXo3tRwjh803kKOyYM/27Dezg1NHZxFRV/GYSIgMAW77mOJ+Qc+PWPJKGu+ UfhNiCBJFTfYenJA4CiOSRa2phGEc5eOO9vt3K4MqkYNFDIu6K784v4zGme0PG+bH/FaTvjrX6K8Ag==
Archived-At: <https://mailarchive.ietf.org/arch/msg/apps-discuss/8Y1Dv4g14z6lBsljwT3LO9C8KGc>
Subject: [apps-discuss] Question about RFC 7239
X-BeenThere: apps-discuss@ietf.org
X-Mailman-Version: 2.1.17
Precedence: list
Reply-To: "luigipinca@libero.it" <luigipinca@libero.it>
List-Id: General discussion of application-layer protocols <apps-discuss.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/apps-discuss>, <mailto:apps-discuss-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/apps-discuss/>
List-Post: <mailto:apps-discuss@ietf.org>
List-Help: <mailto:apps-discuss-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/apps-discuss>, <mailto:apps-discuss-request@ietf.org?subject=subscribe>
X-List-Received-Date: Sun, 28 Aug 2016 19:56:35 -0000

Hello,
I have a question about the "Forwarded" HTTP header field, defined in section 4 of RFC 7239.
The ABNF definition for the header field value is:

Forwarded   = 1#forwarded-element

forwarded-element =
   [ forwarded-pair ] *( ";" [ forwarded-pair ] )

forwarded-pair = token "=" value
value          = token / quoted-string

token = <Defined in [RFC7230], Section 3.2.6>
quoted-string = <Defined in [RFC7230], Section 3.2.6>

If I'm reading this correctly, an empty forwarded-element or one made of only ";"  is a valid element.
For example these values:

Forwarded: ;
Forwarded: ,;
Forwarded: ;,,

are all valid.

Why is an empty forwarded-element allowed? Wouldn't it be better to use an ABNF definition like this?

Forwarded =
   forwarded-element *( "," forwarded-element )

forwarded-element =
   forwarded-pair *( ";" forwarded-pair )

forwarded-pair = token "=" value
value          = token / quoted-string

token = <Defined in [RFC7230], Section 3.2.6>
quoted-string = <Defined in [RFC7230], Section 3.2.6>

Thank you.

Regards,

Luigi