| draft-reschke-http-jfv-07.txt | draft-reschke-http-jfv-08.txt | |||
|---|---|---|---|---|
| Network Working Group J. Reschke | Network Working Group J. Reschke | |||
| Internet-Draft greenbytes | Internet-Draft greenbytes | |||
| Intended status: Standards Track October 24, 2017 | Intended status: Standards Track February 2, 2018 | |||
| Expires: April 27, 2018 | Expires: August 6, 2018 | |||
| A JSON Encoding for HTTP Header Field Values | A JSON Encoding for HTTP Header Field Values | |||
| draft-reschke-http-jfv-07 | draft-reschke-http-jfv-08 | |||
| Abstract | Abstract | |||
| This document establishes a convention for use of JSON-encoded field | This document establishes a convention for use of JSON-encoded field | |||
| values in HTTP header fields. | values in HTTP header fields. | |||
| Editorial Note (To be removed by RFC Editor before publication) | Editorial Note (To be removed by RFC Editor before publication) | |||
| Distribution of this document is unlimited. Although this is not a | Distribution of this document is unlimited. Although this is not a | |||
| work item of the HTTPbis Working Group, comments should be sent to | work item of the HTTPbis Working Group, comments should be sent to | |||
| the Hypertext Transfer Protocol (HTTP) mailing list at ietf-http- | the Hypertext Transfer Protocol (HTTP) mailing list at ietf-http- | |||
| wg@w3.org [1], which may be joined by sending a message with subject | wg@w3.org [1], which may be joined by sending a message with subject | |||
| "subscribe" to ietf-http-wg-request@w3.org [2]. | "subscribe" to ietf-http-wg-request@w3.org [2]. | |||
| Discussions of the HTTPbis Working Group are archived at | Discussions of the HTTPbis Working Group are archived at | |||
| <http://lists.w3.org/Archives/Public/ietf-http-wg/>. | <http://lists.w3.org/Archives/Public/ietf-http-wg/>. | |||
| XML versions and latest edits for this document are available from | XML versions and latest edits for this document are available from | |||
| <http://greenbytes.de/tech/webdav/#draft-reschke-http-jfv>. | <http://greenbytes.de/tech/webdav/#draft-reschke-http-jfv>. | |||
| The changes in this draft are summarized in Appendix E.10. | The changes in this draft are summarized in Appendix E.11. | |||
| Status of This Memo | Status of This Memo | |||
| This Internet-Draft is submitted in full conformance with the | This Internet-Draft is submitted in full conformance with the | |||
| provisions of BCP 78 and BCP 79. | provisions of BCP 78 and BCP 79. | |||
| Internet-Drafts are working documents of the Internet Engineering | Internet-Drafts are working documents of the Internet Engineering | |||
| Task Force (IETF). Note that other groups may also distribute | Task Force (IETF). Note that other groups may also distribute | |||
| working documents as Internet-Drafts. The list of current Internet- | working documents as Internet-Drafts. The list of current Internet- | |||
| Drafts is at https://datatracker.ietf.org/drafts/current/. | Drafts is at https://datatracker.ietf.org/drafts/current/. | |||
| Internet-Drafts are draft documents valid for a maximum of six months | Internet-Drafts are draft documents valid for a maximum of six months | |||
| and may be updated, replaced, or obsoleted by other documents at any | and may be updated, replaced, or obsoleted by other documents at any | |||
| time. It is inappropriate to use Internet-Drafts as reference | time. It is inappropriate to use Internet-Drafts as reference | |||
| material or to cite them other than as "work in progress." | material or to cite them other than as "work in progress." | |||
| This Internet-Draft will expire on April 27, 2018. | This Internet-Draft will expire on August 6, 2018. | |||
| Copyright Notice | Copyright Notice | |||
| Copyright (c) 2017 IETF Trust and the persons identified as the | Copyright (c) 2018 IETF Trust and the persons identified as the | |||
| document authors. All rights reserved. | document authors. All rights reserved. | |||
| This document is subject to BCP 78 and the IETF Trust's Legal | This document is subject to BCP 78 and the IETF Trust's Legal | |||
| Provisions Relating to IETF Documents | Provisions Relating to IETF Documents | |||
| (https://trustee.ietf.org/license-info) in effect on the date of | (https://trustee.ietf.org/license-info) in effect on the date of | |||
| publication of this document. Please review these documents | publication of this document. Please review these documents | |||
| carefully, as they describe your rights and restrictions with respect | carefully, as they describe your rights and restrictions with respect | |||
| to this document. Code Components extracted from this document must | to this document. Code Components extracted from this document must | |||
| include Simplified BSD License text as described in Section 4.e of | include Simplified BSD License text as described in Section 4.e of | |||
| the Trust Legal Provisions and are provided without warranty as | the Trust Legal Provisions and are provided without warranty as | |||
| skipping to change at page 3, line 12 ¶ | skipping to change at page 3, line 12 ¶ | |||
| E.1. Since draft-reschke-http-jfv-00 . . . . . . . . . . . . . 15 | E.1. Since draft-reschke-http-jfv-00 . . . . . . . . . . . . . 15 | |||
| E.2. Since draft-reschke-http-jfv-01 . . . . . . . . . . . . . 15 | E.2. Since draft-reschke-http-jfv-01 . . . . . . . . . . . . . 15 | |||
| E.3. Since draft-reschke-http-jfv-02 . . . . . . . . . . . . . 15 | E.3. Since draft-reschke-http-jfv-02 . . . . . . . . . . . . . 15 | |||
| E.4. Since draft-reschke-http-jfv-03 . . . . . . . . . . . . . 15 | E.4. Since draft-reschke-http-jfv-03 . . . . . . . . . . . . . 15 | |||
| E.5. Since draft-reschke-http-jfv-04 . . . . . . . . . . . . . 15 | E.5. Since draft-reschke-http-jfv-04 . . . . . . . . . . . . . 15 | |||
| E.6. Since draft-ietf-httpbis-jfv-00 . . . . . . . . . . . . . 15 | E.6. Since draft-ietf-httpbis-jfv-00 . . . . . . . . . . . . . 15 | |||
| E.7. Since draft-ietf-httpbis-jfv-01 . . . . . . . . . . . . . 15 | E.7. Since draft-ietf-httpbis-jfv-01 . . . . . . . . . . . . . 15 | |||
| E.8. Since draft-ietf-httpbis-jfv-02 . . . . . . . . . . . . . 16 | E.8. Since draft-ietf-httpbis-jfv-02 . . . . . . . . . . . . . 16 | |||
| E.9. Since draft-reschke-http-jfv-05 . . . . . . . . . . . . . 16 | E.9. Since draft-reschke-http-jfv-05 . . . . . . . . . . . . . 16 | |||
| E.10. Since draft-reschke-http-jfv-06 . . . . . . . . . . . . . 16 | E.10. Since draft-reschke-http-jfv-06 . . . . . . . . . . . . . 16 | |||
| E.11. Since draft-reschke-http-jfv-07 . . . . . . . . . . . . . 16 | ||||
| Acknowledgements . . . . . . . . . . . . . . . . . . . . . . . . 16 | Acknowledgements . . . . . . . . . . . . . . . . . . . . . . . . 16 | |||
| Author's Address . . . . . . . . . . . . . . . . . . . . . . . . 16 | Author's Address . . . . . . . . . . . . . . . . . . . . . . . . 16 | |||
| 1. Introduction | 1. Introduction | |||
| Defining syntax for new HTTP header fields ([RFC7230], Section 3.2) | Defining syntax for new HTTP header fields ([RFC7230], Section 3.2) | |||
| is non-trivial. Among the commonly encountered problems are: | is non-trivial. Among the commonly encountered problems are: | |||
| o There is no common syntax for complex field values. Several well- | o There is no common syntax for complex field values. Several well- | |||
| known header fields do use a similarly looking syntax, but it is | known header fields do use a similarly looking syntax, but it is | |||
| skipping to change at page 3, line 42 ¶ | skipping to change at page 3, line 43 ¶ | |||
| encoding scheme is used. Furthermore, APIs usually assume a | encoding scheme is used. Furthermore, APIs usually assume a | |||
| default encoding scheme in order to map from octet sequences to | default encoding scheme in order to map from octet sequences to | |||
| strings (for instance, [XMLHttpRequest] uses the IDL type | strings (for instance, [XMLHttpRequest] uses the IDL type | |||
| "ByteString", effectively resulting in the ISO-8859-1 character | "ByteString", effectively resulting in the ISO-8859-1 character | |||
| encoding scheme [ISO-8859-1] being used). | encoding scheme [ISO-8859-1] being used). | |||
| (See Section 8.3.1 of [RFC7231] for a summary of considerations for | (See Section 8.3.1 of [RFC7231] for a summary of considerations for | |||
| new header fields.) | new header fields.) | |||
| This specification addresses the issues listed above by defining both | This specification addresses the issues listed above by defining both | |||
| a generic JSON-based ([RFC7159]) data model and a concrete wire | a generic JSON-based ([RFC8259]) data model and a concrete wire | |||
| format that can be used in definitions of new header fields, where | format that can be used in definitions of new header fields, where | |||
| the goals were: | the goals were: | |||
| o to be compatible with header field recombination when fields occur | o to be compatible with header field recombination when fields occur | |||
| multiple times in a single message (Section 3.2.2 of [RFC7230]), | multiple times in a single message (Section 3.2.2 of [RFC7230]), | |||
| and | and | |||
| o not to use any problematic characters in the field value (non- | o not to use any problematic characters in the field value (non- | |||
| ASCII characters and certain whitespace characters). | ASCII characters and certain whitespace characters). | |||
| skipping to change at page 4, line 17 ¶ | skipping to change at page 4, line 20 ¶ | |||
| identify and formalize common field structures in existing header | identify and formalize common field structures in existing header | |||
| fields; the syntax defined over there would usually lead to a more | fields; the syntax defined over there would usually lead to a more | |||
| compact notation. | compact notation. | |||
| 2. Data Model and Format | 2. Data Model and Format | |||
| In HTTP, header fields with the same field name can occur multiple | In HTTP, header fields with the same field name can occur multiple | |||
| times within a single message (Section 3.2.2 of [RFC7230]). When | times within a single message (Section 3.2.2 of [RFC7230]). When | |||
| this happens, recipients are allowed to combine the field values | this happens, recipients are allowed to combine the field values | |||
| using commas as delimiter. This rule matches nicely JSON's array | using commas as delimiter. This rule matches nicely JSON's array | |||
| format (Section 5 of [RFC7159]). Thus, the basic data model used | format (Section 5 of [RFC8259]). Thus, the basic data model used | |||
| here is the JSON array. | here is the JSON array. | |||
| Header field definitions that need only a single value can restrict | Header field definitions that need only a single value can restrict | |||
| themselves to arrays of length 1, and are encouraged to define error | themselves to arrays of length 1, and are encouraged to define error | |||
| handling in case more values are received (such as "first wins", | handling in case more values are received (such as "first wins", | |||
| "last wins", or "abort with fatal error message"). | "last wins", or "abort with fatal error message"). | |||
| JSON arrays are mapped to field values by creating a sequence of | JSON arrays are mapped to field values by creating a sequence of | |||
| serialized member elements, separated by commas and optionally | serialized member elements, separated by commas and optionally | |||
| whitespace. This is equivalent to using the full JSON array format, | whitespace. This is equivalent to using the full JSON array format, | |||
| skipping to change at page 4, line 43 ¶ | skipping to change at page 4, line 46 ¶ | |||
| CR = %x0D ; carriage return | CR = %x0D ; carriage return | |||
| HTAB = %x09 ; horizontal tab | HTAB = %x09 ; horizontal tab | |||
| LF = %x0A ; line feed | LF = %x0A ; line feed | |||
| SP = %x20 ; space | SP = %x20 ; space | |||
| VCHAR = %x21-7E ; visible (printing) characters | VCHAR = %x21-7E ; visible (printing) characters | |||
| Characters in JSON strings that are not allowed or discouraged in | Characters in JSON strings that are not allowed or discouraged in | |||
| HTTP header field values -- that is, not in the "VCHAR" definition -- | HTTP header field values -- that is, not in the "VCHAR" definition -- | |||
| need to be represented using JSON's "backslash" escaping mechanism | need to be represented using JSON's "backslash" escaping mechanism | |||
| ([RFC7159], Section 7). | ([RFC8259], Section 7). | |||
| The control characters CR, LF, and HTAB do not appear inside JSON | The control characters CR, LF, and HTAB do not appear inside JSON | |||
| strings, but can be used outside (line breaks, indentation etc.). | strings, but can be used outside (line breaks, indentation etc.). | |||
| These characters need to be either stripped or replaced by space | These characters need to be either stripped or replaced by space | |||
| characters (ABNF "SP"). | characters (ABNF "SP"). | |||
| Formally, using the HTTP specification's ABNF extensions defined in | Formally, using the HTTP specification's ABNF extensions defined in | |||
| Section 7 of [RFC7230]: | Section 7 of [RFC7230]: | |||
| json-field-value = #json-field-item | json-field-value = #json-field-item | |||
| json-field-item = JSON-Text | json-field-item = JSON-Text | |||
| ; see [RFC7159], Section 2, | ; see [RFC8259], Section 2, | |||
| ; post-processed so that only VCHAR characters | ; post-processed so that only VCHAR characters | |||
| ; are used | ; are used | |||
| 3. Sender Requirements | 3. Sender Requirements | |||
| To map a JSON array to an HTTP header field value, process each array | To map a JSON array to an HTTP header field value, process each array | |||
| element separately by: | element separately by: | |||
| 1. generating the JSON representation, | 1. generating the JSON representation, | |||
| 2. stripping all JSON control characters (CR, HTAB, LF), or | 2. stripping all JSON control characters (CR, HTAB, LF), or | |||
| replacing them by space ("SP") characters, | replacing them by space ("SP") characters, | |||
| 3. replacing all remaining non-VSPACE characters by the equivalent | 3. replacing all remaining non-VSPACE characters by the equivalent | |||
| backslash-escape sequence ([RFC7159], Section 7). | backslash-escape sequence ([RFC8259], Section 7). | |||
| The resulting list of strings is transformed into an HTTP field value | The resulting list of strings is transformed into an HTTP field value | |||
| by combining them using comma (%x2C) plus optional SP as delimiter, | by combining them using comma (%x2C) plus optional SP as delimiter, | |||
| and encoding the resulting string into an octet sequence using the | and encoding the resulting string into an octet sequence using the | |||
| US-ASCII character encoding scheme ([RFC0020]). | US-ASCII character encoding scheme ([RFC0020]). | |||
| 4. Recipient Requirements | 4. Recipient Requirements | |||
| To map a set of HTTP header field instances to a JSON array: | To map a set of HTTP header field instances to a JSON array: | |||
| skipping to change at page 5, line 49 ¶ | skipping to change at page 6, line 4 ¶ | |||
| 3. run the resulting octet sequence through a JSON parser. | 3. run the resulting octet sequence through a JSON parser. | |||
| The result of the parsing operation is either an error (in which case | The result of the parsing operation is either an error (in which case | |||
| the header field values needs to be considered invalid), or a JSON | the header field values needs to be considered invalid), or a JSON | |||
| array. | array. | |||
| 5. Using this Format in Header Field Definitions | 5. Using this Format in Header Field Definitions | |||
| Specifications defining new HTTP header fields need to take the | Specifications defining new HTTP header fields need to take the | |||
| considerations listed in Section 8.3.1 of [RFC7231] into account. | considerations listed in Section 8.3.1 of [RFC7231] into account. | |||
| Many of these will already be accounted for by using the format | Many of these will already be accounted for by using the format | |||
| defined in this specification. | defined in this specification. | |||
| Readers of HTTP-related specifications frequently expect an ABNF | Readers of HTTP-related specifications frequently expect an ABNF | |||
| definition of the field value syntax. This is not really needed | definition of the field value syntax. This is not really needed | |||
| here, as the actual syntax is JSON text, as defined in Section 2 of | here, as the actual syntax is JSON text, as defined in Section 2 of | |||
| [RFC7159]. | [RFC8259]. | |||
| A very simple way to use this JSON encoding thus is just to cite this | A very simple way to use this JSON encoding thus is just to cite this | |||
| specification -- specifically the "json-field-value" ABNF production | specification -- specifically the "json-field-value" ABNF production | |||
| defined in Section 2 -- and otherwise not to talk about the details | defined in Section 2 -- and otherwise not to talk about the details | |||
| of the field syntax at all. | of the field syntax at all. | |||
| An alternative approach is just to repeat the ABNF-related parts from | An alternative approach is just to repeat the ABNF-related parts from | |||
| Section 2. | Section 2. | |||
| This frees the specification from defining the concrete on-the-wire | This frees the specification from defining the concrete on-the-wire | |||
| skipping to change at page 7, line 7 ¶ | skipping to change at page 7, line 7 ¶ | |||
| characters, and thus by definition use a subset of UTF-8 (Section 2.1 | characters, and thus by definition use a subset of UTF-8 (Section 2.1 | |||
| of [RFC7493]). | of [RFC7493]). | |||
| 7.2. Numbers | 7.2. Numbers | |||
| Be aware of the issues around number precision, as discussed in | Be aware of the issues around number precision, as discussed in | |||
| Section 2.2 of [RFC7493]. | Section 2.2 of [RFC7493]. | |||
| 7.3. Object Constraints | 7.3. Object Constraints | |||
| As described in Section 4 of [RFC7159], JSON parser implementations | As described in Section 4 of [RFC8259], JSON parser implementations | |||
| differ in the handling of duplicate object names. Therefore, senders | differ in the handling of duplicate object names. Therefore, senders | |||
| MUST NOT use duplicate object names, and recipients SHOULD either | MUST NOT use duplicate object names, and recipients SHOULD either | |||
| treat field values with duplicate names as invalid (consistent with | treat field values with duplicate names as invalid (consistent with | |||
| [RFC7493], Section 2.3) or use the lexically last value (consistent | [RFC7493], Section 2.3) or use the lexically last value (consistent | |||
| with [ECMA-262], Section 24.3.1.1). | with [ECMA-262], Section 24.3.1.1). | |||
| Furthermore, ordering of object members is not significant and can | Furthermore, ordering of object members is not significant and can | |||
| not be relied upon. | not be relied upon. | |||
| 8. Internationalization Considerations | 8. Internationalization Considerations | |||
| skipping to change at page 7, line 37 ¶ | skipping to change at page 7, line 37 ¶ | |||
| internationalization problem. | internationalization problem. | |||
| Future specifications of HTTP might change to allow non-ASCII | Future specifications of HTTP might change to allow non-ASCII | |||
| characters natively. In that case, header fields using the syntax | characters natively. In that case, header fields using the syntax | |||
| defined by this specification would have a simple migration path (by | defined by this specification would have a simple migration path (by | |||
| just stopping to require escaping of non-ASCII characters). | just stopping to require escaping of non-ASCII characters). | |||
| 9. Security Considerations | 9. Security Considerations | |||
| Using JSON-shaped field values is believed to not introduce any new | Using JSON-shaped field values is believed to not introduce any new | |||
| threads beyond those described in Section 12 of [RFC7159], namely the | threads beyond those described in Section 12 of [RFC8259], namely the | |||
| risk of recipients using the wrong tools to parse them. | risk of recipients using the wrong tools to parse them. | |||
| Other than that, any syntax that makes extensions easy can be used to | Other than that, any syntax that makes extensions easy can be used to | |||
| smuggle information through field values; however, this concern is | smuggle information through field values; however, this concern is | |||
| shared with other widely used formats, such as those using parameters | shared with other widely used formats, such as those using parameters | |||
| in the form of name/value pairs. | in the form of name/value pairs. | |||
| 10. References | 10. References | |||
| 10.1. Normative References | 10.1. Normative References | |||
| [RFC0020] Cerf, V., "ASCII format for network interchange", STD 80, | [RFC0020] Cerf, V., "ASCII format for network interchange", STD 80, | |||
| RFC 20, DOI 10.17487/RFC0020, October 1969, | RFC 20, DOI 10.17487/RFC0020, October 1969, | |||
| <https://www.rfc-editor.org/info/rfc20>. | <https://www.rfc-editor.org/info/rfc20>. | |||
| [RFC5234] Crocker, D., Ed. and P. Overell, "Augmented BNF for Syntax | [RFC5234] Crocker, D., Ed. and P. Overell, "Augmented BNF for Syntax | |||
| Specifications: ABNF", STD 68, RFC 5234, | Specifications: ABNF", STD 68, RFC 5234, | |||
| DOI 10.17487/RFC5234, January 2008, | DOI 10.17487/RFC5234, January 2008, | |||
| <https://www.rfc-editor.org/info/rfc5234>. | <https://www.rfc-editor.org/info/rfc5234>. | |||
| [RFC7159] Bray, T., "The JavaScript Object Notation (JSON) Data | ||||
| Interchange Format", RFC 7159, DOI 10.17487/RFC7159, March | ||||
| 2014, <https://www.rfc-editor.org/info/rfc7159>. | ||||
| [RFC7230] Fielding, R., Ed. and J. Reschke, Ed., "Hypertext Transfer | [RFC7230] Fielding, R., Ed. and J. Reschke, Ed., "Hypertext Transfer | |||
| Protocol (HTTP/1.1): Message Syntax and Routing", | Protocol (HTTP/1.1): Message Syntax and Routing", | |||
| RFC 7230, DOI 10.17487/RFC7230, June 2014, | RFC 7230, DOI 10.17487/RFC7230, June 2014, | |||
| <https://www.rfc-editor.org/info/rfc7230>. | <https://www.rfc-editor.org/info/rfc7230>. | |||
| [RFC7231] Fielding, R., Ed. and J. Reschke, Ed., "Hypertext Transfer | [RFC7231] Fielding, R., Ed. and J. Reschke, Ed., "Hypertext Transfer | |||
| Protocol (HTTP/1.1): Semantics and Content", RFC 7231, | Protocol (HTTP/1.1): Semantics and Content", RFC 7231, | |||
| DOI 10.17487/RFC7231, June 2014, | DOI 10.17487/RFC7231, June 2014, | |||
| <https://www.rfc-editor.org/info/rfc7231>. | <https://www.rfc-editor.org/info/rfc7231>. | |||
| [RFC7493] Bray, T., Ed., "The I-JSON Message Format", RFC 7493, | [RFC7493] Bray, T., Ed., "The I-JSON Message Format", RFC 7493, | |||
| DOI 10.17487/RFC7493, March 2015, | DOI 10.17487/RFC7493, March 2015, | |||
| <https://www.rfc-editor.org/info/rfc7493>. | <https://www.rfc-editor.org/info/rfc7493>. | |||
| [RFC8259] Bray, T., "The JavaScript Object Notation (JSON) Data | ||||
| Interchange Format", STD 90, RFC 8259, | ||||
| DOI 10.17487/RFC8259, December 2017, | ||||
| <https://www.rfc-editor.org/info/rfc8259>. | ||||
| 10.2. Informative References | 10.2. Informative References | |||
| [CLEARSITE] | [CLEARSITE] | |||
| West, M., "Clear Site Data", W3C Working Draft WD-clear- | West, M., "Clear Site Data", W3C Working Draft WD-clear- | |||
| site-data-20160720, July 2016, | site-data-20160720, July 2016, | |||
| <http://www.w3.org/TR/2016/WD-clear-site-data-20160720/>. | <http://www.w3.org/TR/2016/WD-clear-site-data-20160720/>. | |||
| Latest version available at <http://www.w3.org/TR/clear- | Latest version available at <http://www.w3.org/TR/clear- | |||
| site-data/>. | site-data/>. | |||
| [ECMA-262] | [ECMA-262] | |||
| Ecma International, "ECMA-262 6th Edition, The ECMAScript | Ecma International, "ECMA-262 6th Edition, The ECMAScript | |||
| 2015 Language Specification", Standard ECMA-262, June | 2015 Language Specification", Standard ECMA-262, June | |||
| 2015, <http://www.ecma-international.org/ecma-262/6.0/>. | 2015, <http://www.ecma-international.org/ecma-262/6.0/>. | |||
| [FEATUREPOL] | [FEATUREPOL] | |||
| Clelland, I., "Clear Site Data", W3C Draft Community Group | Clelland, I., "Clear Site Data", W3C Draft Community Group | |||
| Report , June 2017, | Report , June 2017, | |||
| <https://wicg.github.io/feature-policy/>. | <https://wicg.github.io/feature-policy/>. | |||
| [HSTRUCT] Kamp, P-H., "HTTP Header Common Structure", draft-ietf- | [HSTRUCT] Nottingham, M. and P-H. Kamp, "Structured Headers for | |||
| httpbis-header-structure-01 (work in progress), April | HTTP", draft-ietf-httpbis-header-structure-03 (work in | |||
| 2017. | progress), February 2018. | |||
| [ISO-8859-1] | [ISO-8859-1] | |||
| International Organization for Standardization, | International Organization for Standardization, | |||
| "Information technology -- 8-bit single-byte coded graphic | "Information technology -- 8-bit single-byte coded graphic | |||
| character sets -- Part 1: Latin alphabet No. 1", ISO/ | character sets -- Part 1: Latin alphabet No. 1", ISO/ | |||
| IEC 8859-1:1998, 1998. | IEC 8859-1:1998, 1998. | |||
| [KEY] Fielding, R. and M. Nottingham, "The Key HTTP Response | [KEY] Fielding, R. and M. Nottingham, "The Key HTTP Response | |||
| Header Field", draft-ietf-httpbis-key-01 (work in | Header Field", draft-ietf-httpbis-key-01 (work in | |||
| progress), March 2016. | progress), March 2016. | |||
| skipping to change at page 10, line 17 ¶ | skipping to change at page 10, line 17 ¶ | |||
| This section shows how some of the existing HTTP header fields would | This section shows how some of the existing HTTP header fields would | |||
| look like if they would use the format defined by this specification. | look like if they would use the format defined by this specification. | |||
| A.1. Content-Length | A.1. Content-Length | |||
| "Content-Length" is defined in Section 3.3.2 of [RFC7230], with the | "Content-Length" is defined in Section 3.3.2 of [RFC7230], with the | |||
| field value's ABNF being: | field value's ABNF being: | |||
| Content-Length = 1*DIGIT | Content-Length = 1*DIGIT | |||
| So the field value is similar to a JSON number ([RFC7159], | So the field value is similar to a JSON number ([RFC8259], | |||
| Section 6). | Section 6). | |||
| Content-Length is restricted to a single field instance, as it | Content-Length is restricted to a single field instance, as it | |||
| doesn't use the list production (as per Section 3.2.2 of [RFC7230]). | doesn't use the list production (as per Section 3.2.2 of [RFC7230]). | |||
| However, in practice multiple instances do occur, and the definition | However, in practice multiple instances do occur, and the definition | |||
| of the header field does indeed discuss how to handle these cases. | of the header field does indeed discuss how to handle these cases. | |||
| If Content-Length was defined using the JSON format discussed here, | If Content-Length was defined using the JSON format discussed here, | |||
| the ABNF would be something like: | the ABNF would be something like: | |||
| Content-Length = #number | Content-Length = #number | |||
| ; number: [RFC7159], Section 6 | ; number: [RFC8259], Section 6 | |||
| ...and the prose definition would: | ...and the prose definition would: | |||
| o restrict all numbers to be non-negative integers without | o restrict all numbers to be non-negative integers without | |||
| fractions, and | fractions, and | |||
| o require that the array of values is of length 1 (but allow the | o require that the array of values is of length 1 (but allow the | |||
| case where the array is longer, but all members represent the same | case where the array is longer, but all members represent the same | |||
| value) | value) | |||
| skipping to change at page 14, line 21 ¶ | skipping to change at page 14, line 21 ¶ | |||
| Defined in W3C Working Draft "Clear Site Data" (Section 2.1 of | Defined in W3C Working Draft "Clear Site Data" (Section 2.1 of | |||
| [CLEARSITE]). Latest Editor's Draft at <https://w3c.github.io/ | [CLEARSITE]). Latest Editor's Draft at <https://w3c.github.io/ | |||
| webappsec-clear-site-data/#header> replaces the use of JSON with a | webappsec-clear-site-data/#header> replaces the use of JSON with a | |||
| custom syntax that happens to be somewhat compatible with an array of | custom syntax that happens to be somewhat compatible with an array of | |||
| JSON strings (see <https://lists.w3.org/Archives/Public/ietf-http- | JSON strings (see <https://lists.w3.org/Archives/Public/ietf-http- | |||
| wg/2017AprJun/0214.html> for feedback). | wg/2017AprJun/0214.html> for feedback). | |||
| B.3. W3C Feature Policy Specification | B.3. W3C Feature Policy Specification | |||
| Defined in W3C Draft Community Group Report "Feature Policy" | Originally defined in W3C Draft Community Group Report "Feature | |||
| (Section 6.1 of [FEATUREPOL]). Previously relied on this document, | Policy" (Section 6.1 of [FEATUREPOL]), but now replaced with a custom | |||
| now replicates the syntax into a custom ABNF defined in a separate | syntax (see <https://github.com/WICG/feature-policy/pull/83>). | |||
| section (Section 5.1 of [FEATUREPOL]). | ||||
| Appendix C. Relation to HTTP 'Key' Header Field | Appendix C. Relation to HTTP 'Key' Header Field | |||
| [KEY] aims to improve the cacheability of responses that vary based | [KEY] aims to improve the cacheability of responses that vary based | |||
| on certain request header fields, addressing lack of granularity in | on certain request header fields, addressing lack of granularity in | |||
| the existing "Vary" response header field ([RFC7231], Section 7.1.4). | the existing "Vary" response header field ([RFC7231], Section 7.1.4). | |||
| If the JSON-based format described by this document gains popularity, | If the JSON-based format described by this document gains popularity, | |||
| it might be useful to add a JSON-aware "Key Parameter" (see | it might be useful to add a JSON-aware "Key Parameter" (see | |||
| Section 2.3 of [KEY]). | Section 2.3 of [KEY]). | |||
| skipping to change at page 16, line 25 ¶ | skipping to change at page 16, line 25 ¶ | |||
| Add a few lines on the relation to "Key". | Add a few lines on the relation to "Key". | |||
| Summarize current use of the format. | Summarize current use of the format. | |||
| E.10. Since draft-reschke-http-jfv-06 | E.10. Since draft-reschke-http-jfv-06 | |||
| RFC 5987 is obsoleted by RFC 8187. | RFC 5987 is obsoleted by RFC 8187. | |||
| Upcate CLEARSITE comment. | Upcate CLEARSITE comment. | |||
| E.11. Since draft-reschke-http-jfv-07 | ||||
| Update JSON and HSTRUCT references. | ||||
| FEATUREPOL doesn't use JSON syntax anymore. | ||||
| Acknowledgements | Acknowledgements | |||
| Thanks go to the Hypertext Transfer Protocol Working Group | Thanks go to the Hypertext Transfer Protocol Working Group | |||
| participants. | participants. | |||
| Author's Address | Author's Address | |||
| Julian F. Reschke | Julian F. Reschke | |||
| greenbytes GmbH | greenbytes GmbH | |||
| Hafenweg 16 | Hafenweg 16 | |||
| End of changes. 22 change blocks. | ||||
| 27 lines changed or deleted | 35 lines changed or added | |||
This html diff was produced by rfcdiff 1.45. The latest version is available from http://tools.ietf.org/tools/rfcdiff/ | ||||