On 2011-12-06 20:13, Alex Rousskov wrote: > On 12/06/2011 11:43 AM, James Snell wrote: >> On Tue, Dec 6, 2011 at 8:29 AM, Alex Rousskov wrote: >>> Overall, the Prefer grammar is more complex than any similar construct I >>> saw in HTTPbis Part 1 or Part 6! If I did not miss any existing cases, >>> would it be possible to simplify the Prefer grammar so that existing >>> parsing code and data structures can be reused to deal with it? > >> The grammar for Prefer is modeled closely after the Expect header >> field grammar in Part 2 and adds only the allowance that a preference >> can have it's own value (e.g. "Prefer: wait=10" ... > > As Julian pointed out, expectation-extension in RFC 2616 attempts to use > the same syntax: > >> Expect = 1#expectation >> >> expectation = "100-continue" / expectation-extension >> expectation-extension = token [ "=" ( token / quoted-string ) >> *expect-params ] >> expect-params = ";" token [ "=" ( token / quoted-string ) ] I just sanitized the grammar to: expectation = "100-continue" / expectation-extension expectation-extension = token [ "=" ( token / quoted-string ) *(";" expect-param) ] expect-param = token [ "=" ( token / quoted-string ) ] (<http://trac.tools.ietf.org/wg/httpbis/trac/changeset/1489>). Also, I think while converting the ABNF, we forgot to allow OWS around ";"; I opened a ticket for that: <http://trac.tools.ietf.org/wg/httpbis/trac/ticket/327> > The only difference I see is that expect-params are only allowed for > expectations that start with name=value but I bet that is just a bug > with the closing ']' placement in expectation-extension definition > (something for HTTBis to fix?). Make sense to me; I don't believe anybody is using this anyway, so let's make Prefer and Expect at least the same. (I added your observation to the ticket). > If expectation-extension is fixed, we would have to support the same > syntax for Expect, my "this is too complex!" comment would be > essentially wrong, and you can have the nice-looking wait=10 preference. Agreed. I also need to get this pattern into the Wiki page <http://trac.tools.ietf.org/wg/httpbis/trac/wiki/HeaderFieldTypes> (contributions welcome!). Best regards, JulianReceived on Tuesday, 6 December 2011 19:24:11 UTC
This archive was generated by hypermail 2.4.0 : Thursday, 2 February 2023 18:43:26 UTC