diff --git a/Makefile b/Makefile index f439d7645..e0decbfe7 100644 --- a/Makefile +++ b/Makefile @@ -88,7 +88,7 @@ $(bd)/%.abnf: %.xml lib/extract-artwork.xslt $(saxon) $< lib/xreffer.xslt | $(saxon) - lib/extract-artwork.xslt type="abnf7230" >$@ $(bd)/%.parsed-abnf: $(bd)/%.abnf - $(bap)/bap -i $(bap)/core.abnf -X rfc7405 < $< | LC_COLLATE=C sort | $(bap)/bap -k -i $(bap)/core.abnf -X rfc7405 -l 69 >$@ + $(bap)/bap -i $(bap)/core.abnf -L1 -X rfc7405 < $< | LC_COLLATE=C sort | $(bap)/bap -k -i $(bap)/core.abnf -L1 -X rfc7405 -l 69 >$@ $(bd)/%.abnf-appendix: $(bd)/%.parsed-abnf $(saxon) $*.xml lib/abnf2xml2rfc.xslt abnf="../$<" >$@ diff --git a/bap/main.c b/bap/main.c index 3aadaf1b7..39dca421d 100644 --- a/bap/main.c +++ b/bap/main.c @@ -114,6 +114,7 @@ int qflag = 0; /* quiet */ int canon = 1; /* canonify */ int asxml = 0; /* output XML */ int olenlimit = 0; /* 0 for unlimited, might be any other value */ +int listrulex = 0; /* 0 for RFC 7320-style, 1 for 2019 experimental */ int yyparse(void); @@ -122,7 +123,7 @@ usage(void) { fprintf(stderr, "Bill's ABNF Parser version %s\n", versionstring); fprintf(stderr, " (with extensions from )\n", versionstring); - fprintf(stderr, "usage: bap [-cknqtx][-i rules][-l num][-S name][-X ext][file]\n"); + fprintf(stderr, "usage: bap [-cknqtx][-i rules][-l num][-L rtyp][-S name][-X ext][file]\n"); fprintf(stderr, " parse ABNF grammar from file or stdin\n"); fprintf(stderr, " Input options:\n"); fprintf(stderr, " -c include rule definition line # in comment\n"); @@ -133,6 +134,7 @@ usage(void) fprintf(stderr, " Output options:\n"); fprintf(stderr, " -k add comments for printable characters specified as %%x\n"); fprintf(stderr, " -l num limit the length of each line to \"num\" characters\n"); + fprintf(stderr, " -L rtyp how to expand #list production (0 == 2014, 1 == 2019)\n"); fprintf(stderr, " -n don't \"canonify\" result\n"); fprintf(stderr, " -q don't print parsed grammar\n"); fprintf(stderr, " -t include type info in result\n"); @@ -155,7 +157,7 @@ main(int argc, char **argv) #endif hcreate(MAXRULE); - while ((ch = getopt(argc, argv, "cdi:kntqS:xl:X:")) != -1) { + while ((ch = getopt(argc, argv, "cdi:kntqS:xl:L:X:")) != -1) { switch (ch) { case 'c': cflag++; @@ -224,6 +226,14 @@ main(int argc, char **argv) olenlimit = atoi(optarg); break; + case 'L': + listrulex = atoi(optarg); + if (listrulex != 0 && listrulex != 1) { + fprintf(stderr, "-L: illegal argument %d\n", listrulex); + exit(2); + } + break; + default: usage(); } @@ -416,6 +426,61 @@ printobjasxml(object *o, int indent) */ #define NOBRACKET(o) ((o->next == NULL) && (o->u.e.repetition.lo == 0)) +// code to emit #rule (RFC 7230) +static void +p_listrule_rfc7230(object *o) +{ + if (o->u.e.repetition.lo == 0) { + local_printf("[ ( \",\" / "); + if (o->u.e.e.rule.rule) { + local_printf("%s", o->u.e.e.rule.rule->name); + o->u.e.e.rule.rule->used = 1; + } else { + local_printf("%s", o->u.e.e.rule.name); + } + local_printf(" ) *( OWS \",\" [ OWS "); + local_printf("%s", (o->u.e.e.rule.rule) ? + o->u.e.e.rule.rule->name : + o->u.e.e.rule.name); + local_printf(" ] ) ]"); + } else if (o->u.e.repetition.lo == 1) { + local_printf(" *( \",\" OWS ) "); + if (o->u.e.e.rule.rule) { + local_printf("%s", o->u.e.e.rule.rule->name); + o->u.e.e.rule.rule->used = 1; + } else { + local_printf("%s", o->u.e.e.rule.name); + } + local_printf(" *( OWS \",\" [ OWS "); + local_printf("%s", (o->u.e.e.rule.rule) ? + o->u.e.e.rule.rule->name : + o->u.e.e.rule.name); + local_printf(" ] )"); + } + else { + local_printf("TODO: something is wrong"); + } +} + +// code to emit #rule (2019) +// #element => *( OWS "," ) *( [ OWS element ] OWS "," ) +static void +p_listrule_2019(object *o) +{ + local_printf("[ "); + if (o->u.e.e.rule.rule) { + local_printf("%s", o->u.e.e.rule.rule->name); + o->u.e.e.rule.rule->used = 1; + } else { + local_printf("%s", o->u.e.e.rule.name); + } + local_printf(" ] *( OWS \",\" OWS [ "); + local_printf("%s", (o->u.e.e.rule.rule) ? + o->u.e.e.rule.rule->name : + o->u.e.e.rule.name); + local_printf(" ] )"); +} + static void printobj_r(object *o, int parenttype, int tflag) { @@ -441,38 +506,13 @@ printobj_r(object *o, int parenttype, int tflag) break; case T_RULE: /* identation to delimit the code change */ if (tflag) - local_printf("{RULE}"); + local_printf("{RULE}"); if (o->u.e.islist) { - if (o->u.e.repetition.lo == 0) { - local_printf("[ ( \",\" / "); - if (o->u.e.e.rule.rule) { - local_printf("%s", o->u.e.e.rule.rule->name); - o->u.e.e.rule.rule->used = 1; - } else { - local_printf("%s", o->u.e.e.rule.name); - } - local_printf(" ) *( OWS \",\" [ OWS "); - local_printf("%s", (o->u.e.e.rule.rule) ? - o->u.e.e.rule.rule->name : - o->u.e.e.rule.name); - local_printf(" ] ) ]"); - } else if (o->u.e.repetition.lo == 1) { - local_printf(" *( \",\" OWS ) "); - if (o->u.e.e.rule.rule) { - local_printf("%s", o->u.e.e.rule.rule->name); - o->u.e.e.rule.rule->used = 1; - } else { - local_printf("%s", o->u.e.e.rule.name); - } - local_printf(" *( OWS \",\" [ OWS "); - local_printf("%s", (o->u.e.e.rule.rule) ? - o->u.e.e.rule.rule->name : - o->u.e.e.rule.name); - local_printf(" ] )"); - } - else { - local_printf("TODO: something is wrong"); - } + if (listrulex == 0) { + p_listrule_rfc7230(o); + } else { + p_listrule_2019(o); + } } else { printrep(&o->u.e.repetition); if (o->u.e.e.rule.rule) { diff --git a/draft-ietf-httpbis-cache-latest.html b/draft-ietf-httpbis-cache-latest.html index a04f8d142..f2cc51062 100644 --- a/draft-ietf-httpbis-cache-latest.html +++ b/draft-ietf-httpbis-cache-latest.html @@ -2438,8 +2438,8 @@

Appendix A. 
Age = delta-seconds
 
-Cache-Control = *( "," OWS ) cache-directive *( OWS "," [ OWS
- cache-directive ] )
+Cache-Control = [ cache-directive ] *( OWS "," OWS [ cache-directive
+ ] )
 
 Expires = HTTP-date
 
diff --git a/draft-ietf-httpbis-cache-latest.xml b/draft-ietf-httpbis-cache-latest.xml
index 2cdbaa2ef..568b941a3 100644
--- a/draft-ietf-httpbis-cache-latest.xml
+++ b/draft-ietf-httpbis-cache-latest.xml
@@ -2199,8 +2199,8 @@
 
In the collected ABNF below, list rules are expanded as per . Age = delta-seconds -Cache-Control = *( "," OWS ) cache-directive *( OWS "," [ OWS - cache-directive ] ) +Cache-Control = [ cache-directive ] *( OWS "," OWS [ cache-directive + ] ) Expires = HTTP-date diff --git a/draft-ietf-httpbis-messaging-latest.html b/draft-ietf-httpbis-messaging-latest.html index b777830a2..41cde1cde 100644 --- a/draft-ietf-httpbis-messaging-latest.html +++ b/draft-ietf-httpbis-messaging-latest.html @@ -2909,8 +2909,8 @@

Appendix A. 

BWS = <BWS, see [Semantics], Section 4.3>
 
-Connection = *( "," OWS ) connection-option *( OWS "," [ OWS
- connection-option ] )
+Connection = [ connection-option ] *( OWS "," OWS [ connection-option
+ ] )
 
 HTTP-message = start-line *( header-field CRLF ) CRLF [ message-body
  ]
@@ -2921,11 +2921,11 @@ 

Appendix A.  RWS = <RWS, see [Semantics], Section 4.3> -TE = [ ( "," / t-codings ) *( OWS "," [ OWS t-codings ] ) ] -Transfer-Encoding = *( "," OWS ) transfer-coding *( OWS "," [ OWS +TE = [ t-codings ] *( OWS "," OWS [ t-codings ] ) +Transfer-Encoding = [ transfer-coding ] *( OWS "," OWS [ transfer-coding ] ) -Upgrade = *( "," OWS ) protocol *( OWS "," [ OWS protocol ] ) +Upgrade = [ protocol ] *( OWS "," OWS [ protocol ] ) absolute-URI = <absolute-URI, see [RFC3986], Section 4.3> absolute-form = absolute-URI diff --git a/draft-ietf-httpbis-messaging-latest.xml b/draft-ietf-httpbis-messaging-latest.xml index c4d0658db..963c929f5 100644 --- a/draft-ietf-httpbis-messaging-latest.xml +++ b/draft-ietf-httpbis-messaging-latest.xml @@ -3007,8 +3007,8 @@ Upgrade: HTTP/2.0
In the collected ABNF below, list rules are expanded as per . BWS = <BWS, see > -Connection = *( "," OWS ) connection-option *( OWS "," [ OWS - connection-option ] ) +Connection = [ connection-option ] *( OWS "," OWS [ connection-option + ] ) HTTP-message = start-line *( header-field CRLF ) CRLF [ message-body ] @@ -3019,11 +3019,11 @@ Upgrade: HTTP/2.0 RWS = <RWS, see > -TE = [ ( "," / t-codings ) *( OWS "," [ OWS t-codings ] ) ] -Transfer-Encoding = *( "," OWS ) transfer-coding *( OWS "," [ OWS +TE = [ t-codings ] *( OWS "," OWS [ t-codings ] ) +Transfer-Encoding = [ transfer-coding ] *( OWS "," OWS [ transfer-coding ] ) -Upgrade = *( "," OWS ) protocol *( OWS "," [ OWS protocol ] ) +Upgrade = [ protocol ] *( OWS "," OWS [ protocol ] ) absolute-URI = <absolute-URI, see > absolute-form = absolute-URI diff --git a/draft-ietf-httpbis-semantics-latest.html b/draft-ietf-httpbis-semantics-latest.html index 5e770c751..7d41dcd5b 100644 --- a/draft-ietf-httpbis-semantics-latest.html +++ b/draft-ietf-httpbis-semantics-latest.html @@ -8633,39 +8633,41 @@

11. 
  <n>#<m>element => element <n-1>*<m-1>( OWS "," OWS element )
 

-
  #element => [ ( "," / element ) *( OWS "," [ OWS element ] ) ]
-  
-  1#element => *( "," OWS ) element *( OWS "," [ OWS element ] )
+         
  #element => [ element ] *( OWS "," OWS [ element ] )
 
-
-

Empty elements do not contribute to the count of elements present. For example, given - these ABNF productions:

+
+

Note that because of the potential presence of empty list elements, the RFC 5234 ABNF + cannot enforce the cardinality of list elements, and consequently all cases are mapped + is if there was no cardinality specified.

+
+
+

For example, given these ABNF productions:

-
  example-list      = 1#example-list-elmt
+         
  example-list      = 1#example-list-elmt
   example-list-elmt = token ; see Section 4.2.3 
 
-
+

Then the following are valid values for example-list (not including the double quotes, - which are present for delimitation only):

+ which are present for delimitation only):

-
  "foo,bar"
+         
  "foo,bar"
   "foo ,bar,"
   "foo , ,bar,charlie"
 
-
+

In contrast, the following values would be invalid, since at least one non-empty element - is required by the example-list production:

+ is required by the example-list production:

-
  ""
+         
  ""
   ","
   ",   ,"
 
-
-

Appendix A shows the collected ABNF for recipients after the list constructs have been expanded.

+
+

Appendix A shows the collected ABNF for recipients after the list constructs have been expanded.

@@ -9420,17 +9422,16 @@

Appendix A.  Accept-Language = *( "," OWS ) ( language-range [ weight ] ) *( OWS "," [ OWS ( language-range [ weight ] ) ] ) Accept-Ranges = acceptable-ranges -Allow = [ ( "," / method ) *( OWS "," [ OWS method ] ) ] -Authentication-Info = [ ( "," / auth-param ) *( OWS "," [ OWS - auth-param ] ) ] +Allow = [ method ] *( OWS "," OWS [ method ] ) +Authentication-Info = [ auth-param ] *( OWS "," OWS [ auth-param ] ) Authorization = credentials BWS = OWS -Content-Encoding = *( "," OWS ) content-coding *( OWS "," [ OWS - content-coding ] ) -Content-Language = *( "," OWS ) language-tag *( OWS "," [ OWS - language-tag ] ) +Content-Encoding = [ content-coding ] *( OWS "," OWS [ content-coding + ] ) +Content-Language = [ language-tag ] *( OWS "," OWS [ language-tag ] + ) Content-Length = 1*DIGIT Content-Location = absolute-URI / partial-URI Content-Range = byte-content-range / other-content-range @@ -9449,11 +9450,10 @@

Appendix A.  Host = uri-host [ ":" port ] IMF-fixdate = day-name "," SP date1 SP time-of-day SP GMT -If-Match = "*" / ( *( "," OWS ) entity-tag *( OWS "," [ OWS - entity-tag ] ) ) +If-Match = "*" / ( [ entity-tag ] *( OWS "," OWS [ entity-tag ] ) ) If-Modified-Since = HTTP-date -If-None-Match = "*" / ( *( "," OWS ) entity-tag *( OWS "," [ OWS - entity-tag ] ) ) +If-None-Match = "*" / ( [ entity-tag ] *( OWS "," OWS [ entity-tag ] + ) ) If-Range = entity-tag / HTTP-date If-Unmodified-Since = HTTP-date @@ -9464,10 +9464,9 @@

Appendix A.  OWS = *( SP / HTAB ) -Proxy-Authenticate = *( "," OWS ) challenge *( OWS "," [ OWS - challenge ] ) -Proxy-Authentication-Info = [ ( "," / auth-param ) *( OWS "," [ OWS - auth-param ] ) ] +Proxy-Authenticate = [ challenge ] *( OWS "," OWS [ challenge ] ) +Proxy-Authentication-Info = [ auth-param ] *( OWS "," OWS [ + auth-param ] ) Proxy-Authorization = credentials RWS = 1*( SP / HTAB ) @@ -9477,26 +9476,24 @@

Appendix A.  Server = product *( RWS ( product / comment ) ) -Trailer = *( "," OWS ) field-name *( OWS "," [ OWS field-name ] ) +Trailer = [ field-name ] *( OWS "," OWS [ field-name ] ) URI-reference = <URI-reference, see [RFC3986], Section 4.1> User-Agent = product *( RWS ( product / comment ) ) -Vary = "*" / ( *( "," OWS ) field-name *( OWS "," [ OWS field-name ] - ) ) +Vary = "*" / ( [ field-name ] *( OWS "," OWS [ field-name ] ) ) Via = *( "," OWS ) ( received-protocol RWS received-by [ RWS comment ] ) *( OWS "," [ OWS ( received-protocol RWS received-by [ RWS comment ] ) ] ) -WWW-Authenticate = *( "," OWS ) challenge *( OWS "," [ OWS challenge - ] ) +WWW-Authenticate = [ challenge ] *( OWS "," OWS [ challenge ] ) absolute-URI = <absolute-URI, see [RFC3986], Section 4.3> absolute-path = 1*( "/" segment ) accept-ext = OWS ";" OWS token [ "=" ( token / quoted-string ) ] accept-params = weight *accept-ext -acceptable-ranges = ( *( "," OWS ) range-unit *( OWS "," [ OWS - range-unit ] ) ) / "none" +acceptable-ranges = ( [ range-unit ] *( OWS "," OWS [ range-unit ] ) + ) / "none" asctime-date = day-name SP date3 SP time-of-day SP year auth-param = token BWS "=" BWS ( token / quoted-string ) auth-scheme = token @@ -9513,15 +9510,15 @@

Appendix A.  byte-ranges-specifier = bytes-unit "=" byte-range-set bytes-unit = "bytes" -challenge = auth-scheme [ 1*SP ( token68 / [ ( "," / auth-param ) *( - OWS "," [ OWS auth-param ] ) ] ) ] +challenge = auth-scheme [ 1*SP ( token68 / ( [ auth-param ] *( OWS + "," OWS [ auth-param ] ) ) ) ] charset = token codings = content-coding / "identity" / "*" comment = "(" *( ctext / quoted-pair / comment ) ")" complete-length = 1*DIGIT content-coding = token -credentials = auth-scheme [ 1*SP ( token68 / [ ( "," / auth-param ) - *( OWS "," [ OWS auth-param ] ) ] ) ] +credentials = auth-scheme [ 1*SP ( token68 / ( [ auth-param ] *( OWS + "," OWS [ auth-param ] ) ) ) ] ctext = HTAB / SP / %x21-27 ; '!'-''' / %x2A-5B ; '*'-'[' / %x5D-7E ; ']'-'~' @@ -9864,6 +9861,8 @@

I.6. Section 6.2.1, reference MIME Sniffing (<https://github.com/httpwg/http-core/issues/51>) +
  • In Section 11, simplify the #rule mapping for recipients (<https://github.com/httpwg/http-core/issues/164>, <https://www.rfc-editor.org/errata/eid5257>) +
  • In Section 7.3.7, remove misleading text about "extension" of HTTP is needed to define method payloads (<https://github.com/httpwg/http-core/issues/204>)
  • diff --git a/draft-ietf-httpbis-semantics-latest.xml b/draft-ietf-httpbis-semantics-latest.xml index 26eef13fd..de71f1f50 100644 --- a/draft-ietf-httpbis-semantics-latest.xml +++ b/draft-ietf-httpbis-semantics-latest.xml @@ -9498,19 +9498,22 @@ Content-Encoding: gzip <n>#<m>element => element <n-1>*<m-1>( OWS "," OWS element ) - For compatibility with legacy list rules, a recipient &MUST; parse and ignore + Empty elements do not contribute to the count of elements present. + A recipient &MUST; parse and ignore a reasonable number of empty list elements: enough to handle common mistakes by senders that merge values, but not so much that they could be used as a denial-of-service mechanism. In other words, a recipient &MUST; accept lists that satisfy the following syntax: - #element => [ ( "," / element ) *( OWS "," [ OWS element ] ) ] - - 1#element => *( "," OWS ) element *( OWS "," [ OWS element ] ) + #element => [ element ] *( OWS "," OWS [ element ] ) - Empty elements do not contribute to the count of elements present. + Note that because of the potential presence of empty list elements, the + RFC 5234 ABNF cannot enforce the cardinality of list elements, and + consequently all cases are mapped is if there was no cardinality specified. + + For example, given these ABNF productions: @@ -11197,17 +11200,16 @@ Content-Encoding: gzip Accept-Language = *( "," OWS ) ( language-range [ weight ] ) *( OWS "," [ OWS ( language-range [ weight ] ) ] ) Accept-Ranges = acceptable-ranges -Allow = [ ( "," / method ) *( OWS "," [ OWS method ] ) ] -Authentication-Info = [ ( "," / auth-param ) *( OWS "," [ OWS - auth-param ] ) ] +Allow = [ method ] *( OWS "," OWS [ method ] ) +Authentication-Info = [ auth-param ] *( OWS "," OWS [ auth-param ] ) Authorization = credentials BWS = OWS -Content-Encoding = *( "," OWS ) content-coding *( OWS "," [ OWS - content-coding ] ) -Content-Language = *( "," OWS ) language-tag *( OWS "," [ OWS - language-tag ] ) +Content-Encoding = [ content-coding ] *( OWS "," OWS [ content-coding + ] ) +Content-Language = [ language-tag ] *( OWS "," OWS [ language-tag ] + ) Content-Length = 1*DIGIT Content-Location = absolute-URI / partial-URI Content-Range = byte-content-range / other-content-range @@ -11226,11 +11228,10 @@ Content-Encoding: gzip Host = uri-host [ ":" port ] IMF-fixdate = day-name "," SP date1 SP time-of-day SP GMT -If-Match = "*" / ( *( "," OWS ) entity-tag *( OWS "," [ OWS - entity-tag ] ) ) +If-Match = "*" / ( [ entity-tag ] *( OWS "," OWS [ entity-tag ] ) ) If-Modified-Since = HTTP-date -If-None-Match = "*" / ( *( "," OWS ) entity-tag *( OWS "," [ OWS - entity-tag ] ) ) +If-None-Match = "*" / ( [ entity-tag ] *( OWS "," OWS [ entity-tag ] + ) ) If-Range = entity-tag / HTTP-date If-Unmodified-Since = HTTP-date @@ -11241,10 +11242,9 @@ Content-Encoding: gzip OWS = *( SP / HTAB ) -Proxy-Authenticate = *( "," OWS ) challenge *( OWS "," [ OWS - challenge ] ) -Proxy-Authentication-Info = [ ( "," / auth-param ) *( OWS "," [ OWS - auth-param ] ) ] +Proxy-Authenticate = [ challenge ] *( OWS "," OWS [ challenge ] ) +Proxy-Authentication-Info = [ auth-param ] *( OWS "," OWS [ + auth-param ] ) Proxy-Authorization = credentials RWS = 1*( SP / HTAB ) @@ -11254,26 +11254,24 @@ Content-Encoding: gzip Server = product *( RWS ( product / comment ) ) -Trailer = *( "," OWS ) field-name *( OWS "," [ OWS field-name ] ) +Trailer = [ field-name ] *( OWS "," OWS [ field-name ] ) URI-reference = <URI-reference, see > User-Agent = product *( RWS ( product / comment ) ) -Vary = "*" / ( *( "," OWS ) field-name *( OWS "," [ OWS field-name ] - ) ) +Vary = "*" / ( [ field-name ] *( OWS "," OWS [ field-name ] ) ) Via = *( "," OWS ) ( received-protocol RWS received-by [ RWS comment ] ) *( OWS "," [ OWS ( received-protocol RWS received-by [ RWS comment ] ) ] ) -WWW-Authenticate = *( "," OWS ) challenge *( OWS "," [ OWS challenge - ] ) +WWW-Authenticate = [ challenge ] *( OWS "," OWS [ challenge ] ) absolute-URI = <absolute-URI, see > absolute-path = 1*( "/" segment ) accept-ext = OWS ";" OWS token [ "=" ( token / quoted-string ) ] accept-params = weight *accept-ext -acceptable-ranges = ( *( "," OWS ) range-unit *( OWS "," [ OWS - range-unit ] ) ) / "none" +acceptable-ranges = ( [ range-unit ] *( OWS "," OWS [ range-unit ] ) + ) / "none" asctime-date = day-name SP date3 SP time-of-day SP year auth-param = token BWS "=" BWS ( token / quoted-string ) auth-scheme = token @@ -11290,15 +11288,15 @@ Content-Encoding: gzip byte-ranges-specifier = bytes-unit "=" byte-range-set bytes-unit = "bytes" -challenge = auth-scheme [ 1*SP ( token68 / [ ( "," / auth-param ) *( - OWS "," [ OWS auth-param ] ) ] ) ] +challenge = auth-scheme [ 1*SP ( token68 / ( [ auth-param ] *( OWS + "," OWS [ auth-param ] ) ) ) ] charset = token codings = content-coding / "identity" / "*" comment = "(" *( ctext / quoted-pair / comment ) ")" complete-length = 1*DIGIT content-coding = token -credentials = auth-scheme [ 1*SP ( token68 / [ ( "," / auth-param ) - *( OWS "," [ OWS auth-param ] ) ] ) ] +credentials = auth-scheme [ 1*SP ( token68 / ( [ auth-param ] *( OWS + "," OWS [ auth-param ] ) ) ) ] ctext = HTAB / SP / %x21-27 ; '!'-''' / %x2A-5B ; '*'-'[' / %x5D-7E ; ']'-'~' @@ -11579,6 +11577,7 @@ Content-Encoding: gzip
    • Move into its own section ()
    • In , reference MIME Sniffing ()
    • +
    • In , simplify the #rule mapping for recipients (, )
    • In , remove misleading text about "extension" of HTTP is needed to define method payloads ()

    diff --git a/httpbis.abnf b/httpbis.abnf index 667ea1975..f35700ffb 100644 --- a/httpbis.abnf +++ b/httpbis.abnf @@ -8,14 +8,14 @@ Accept-Encoding = [ ( "," / ( codings [ weight ] ) ) *( OWS "," [ OWS ( codings Accept-Language = *( "," OWS ) ( language-range [ weight ] ) *( OWS "," [ OWS ( language-range [ weight ] ) ] ) Accept-Ranges = acceptable-ranges Age = delta-seconds -Allow = [ ( "," / method ) *( OWS "," [ OWS method ] ) ] -Authentication-Info = [ ( "," / auth-param ) *( OWS "," [ OWS auth-param ] ) ] +Allow = [ method ] *( OWS "," OWS [ method ] ) +Authentication-Info = [ auth-param ] *( OWS "," OWS [ auth-param ] ) Authorization = credentials BWS = OWS -Cache-Control = *( "," OWS ) cache-directive *( OWS "," [ OWS cache-directive ] ) -Connection = *( "," OWS ) connection-option *( OWS "," [ OWS connection-option ] ) -Content-Encoding = *( "," OWS ) content-coding *( OWS "," [ OWS content-coding ] ) -Content-Language = *( "," OWS ) language-tag *( OWS "," [ OWS language-tag ] ) +Cache-Control = [ cache-directive ] *( OWS "," OWS [ cache-directive ] ) +Connection = [ connection-option ] *( OWS "," OWS [ connection-option ] ) +Content-Encoding = [ content-coding ] *( OWS "," OWS [ content-coding ] ) +Content-Language = [ language-tag ] *( OWS "," OWS [ language-tag ] ) Content-Length = 1*DIGIT Content-Location = absolute-URI / partial-URI Content-Range = byte-content-range / other-content-range @@ -34,38 +34,38 @@ HTTP-name = %x48.54.54.50 ; HTTP HTTP-version = HTTP-name "/" DIGIT "." DIGIT Host = uri-host [ ":" port ] IMF-fixdate = day-name "," SP date1 SP time-of-day SP GMT -If-Match = "*" / ( *( "," OWS ) entity-tag *( OWS "," [ OWS entity-tag ] ) ) +If-Match = "*" / ( [ entity-tag ] *( OWS "," OWS [ entity-tag ] ) ) If-Modified-Since = HTTP-date -If-None-Match = "*" / ( *( "," OWS ) entity-tag *( OWS "," [ OWS entity-tag ] ) ) +If-None-Match = "*" / ( [ entity-tag ] *( OWS "," OWS [ entity-tag ] ) ) If-Range = entity-tag / HTTP-date If-Unmodified-Since = HTTP-date Last-Modified = HTTP-date Location = URI-reference Max-Forwards = 1*DIGIT OWS = *( SP / HTAB ) -Proxy-Authenticate = *( "," OWS ) challenge *( OWS "," [ OWS challenge ] ) -Proxy-Authentication-Info = [ ( "," / auth-param ) *( OWS "," [ OWS auth-param ] ) ] +Proxy-Authenticate = [ challenge ] *( OWS "," OWS [ challenge ] ) +Proxy-Authentication-Info = [ auth-param ] *( OWS "," OWS [ auth-param ] ) Proxy-Authorization = credentials RWS = 1*( SP / HTAB ) Range = byte-ranges-specifier / other-ranges-specifier Referer = absolute-URI / partial-URI Retry-After = HTTP-date / delay-seconds Server = product *( RWS ( product / comment ) ) -TE = [ ( "," / t-codings ) *( OWS "," [ OWS t-codings ] ) ] -Trailer = *( "," OWS ) field-name *( OWS "," [ OWS field-name ] ) -Transfer-Encoding = *( "," OWS ) transfer-coding *( OWS "," [ OWS transfer-coding ] ) +TE = [ t-codings ] *( OWS "," OWS [ t-codings ] ) +Trailer = [ field-name ] *( OWS "," OWS [ field-name ] ) +Transfer-Encoding = [ transfer-coding ] *( OWS "," OWS [ transfer-coding ] ) URI-reference = -Upgrade = *( "," OWS ) protocol *( OWS "," [ OWS protocol ] ) +Upgrade = [ protocol ] *( OWS "," OWS [ protocol ] ) User-Agent = product *( RWS ( product / comment ) ) -Vary = "*" / ( *( "," OWS ) field-name *( OWS "," [ OWS field-name ] ) ) +Vary = "*" / ( [ field-name ] *( OWS "," OWS [ field-name ] ) ) Via = *( "," OWS ) ( received-protocol RWS received-by [ RWS comment ] ) *( OWS "," [ OWS ( received-protocol RWS received-by [ RWS comment ] ) ] ) -WWW-Authenticate = *( "," OWS ) challenge *( OWS "," [ OWS challenge ] ) +WWW-Authenticate = [ challenge ] *( OWS "," OWS [ challenge ] ) absolute-URI = absolute-form = absolute-URI absolute-path = 1*( "/" segment ) accept-ext = OWS ";" OWS token [ "=" ( token / quoted-string ) ] accept-params = weight *accept-ext -acceptable-ranges = ( *( "," OWS ) range-unit *( OWS "," [ OWS range-unit ] ) ) / "none" +acceptable-ranges = ( [ range-unit ] *( OWS "," OWS [ range-unit ] ) ) / "none" asctime-date = day-name SP date3 SP time-of-day SP year asterisk-form = "*" auth-param = token BWS "=" BWS ( token / quoted-string ) @@ -80,7 +80,7 @@ byte-range-spec = first-byte-pos "-" [ last-byte-pos ] byte-ranges-specifier = bytes-unit "=" byte-range-set bytes-unit = "bytes" cache-directive = token [ "=" ( token / quoted-string ) ] -challenge = auth-scheme [ 1*SP ( token68 / [ ( "," / auth-param ) *( OWS "," [ OWS auth-param ] ) ] ) ] +challenge = auth-scheme [ 1*SP ( token68 / ( [ auth-param ] *( OWS "," OWS [ auth-param ] ) ) ) ] charset = token chunk = chunk-size [ chunk-ext ] CRLF chunk-data CRLF chunk-data = 1*OCTET @@ -94,7 +94,7 @@ comment = "(" *( ctext / quoted-pair / comment ) ")" complete-length = 1*DIGIT connection-option = token content-coding = token -credentials = auth-scheme [ 1*SP ( token68 / [ ( "," / auth-param ) *( OWS "," [ OWS auth-param ] ) ] ) ] +credentials = auth-scheme [ 1*SP ( token68 / ( [ auth-param ] *( OWS "," OWS [ auth-param ] ) ) ) ] ctext = HTAB / SP / %x21-27 ; '!'-''' / %x2A-5B ; '*'-'[' / %x5D-7E ; ']'-'~' diff --git a/lib/common-abnf.sh b/lib/common-abnf.sh index d53be20ec..b72da5855 100755 --- a/lib/common-abnf.sh +++ b/lib/common-abnf.sh @@ -12,7 +12,7 @@ echo "" for i in "$@" do - $bap/bap -i $bap/core.abnf -X rfc7405 -n "$i" + $bap/bap -i $bap/core.abnf -L 1 -X rfc7405 -n "$i" done | \ fgrep -v ", defined in [Part" | \ fgrep -v ", defined in [Messaging" | \