Subject: Re: [apps-discuss] R: Re: Question about RFC 7239
From: Matthew Kerwin <[email-masked]>
To: "[email-masked]" <[email-masked]>
Cc: Julian Reschke <[email-masked]>, IETF Apps Discuss <[email-masked]>
Date: Mon, 29 Aug 2016 09:22:13 +1000
List-Id: General discussion of application-layer protocols <apps-discuss.ietf.org>

On 29 August 2016 at 07:22, [email-masked] <[email-masked]>
wrote:

> Thank you Julian but I still don't fully get it.
> According to the #rule extension as shown in your link,
>
> "foo , ,bar,"
>
> is a valid value, so I assume that in our case
>
> "; , ,"
>
> is also a valid value as forwarded-element is defined like this
>
> forwarded-element = [ forwarded-pair ] *( ";" [ forwarded-pair ] )
>
>
​The words in RFC 7230 say a lot more than the ABNF does. If you're
concerned about the parser you should accept "a reasonable number of empty
list elements"; but if you're generating headers you "MUST NOT generate
empty list elements." The question, then, is whether ";" is a valid
forwarded-element.

I believe the intention was to make Forwarded be a list of lists, where the
outer list (joined by commas) is as defined in RFC 7230, and the inner list
(joined by semicolons) has the same semantics for ignoring a reasonable
number of empty elements.

To that end, within a single forwarded-element, this might be acceptable: "
;for=1.2.3.4;;proto=http;" (Although I think you probably shouldn't
generate such a value.)

That said, that's only my reading. If it's the case, I suspect maybe it
wasn't made clear enough in RFC 7239.

> My main concern is actually on this definition. Why is forwarded-pair
> optional?
>
> Regards,
>
> Luigi
>

​Cheers​
-- 
  Matthew Kerwin
  http://matthew.kerwin.net.au/