idnits 2.17.1 draft-reschke-rfc2231-in-http-04.txt: Checking boilerplate required by RFC 5378 and the IETF Trust (see https://trustee.ietf.org/license-info): ---------------------------------------------------------------------------- ** The document seems to lack a License Notice according IETF Trust Provisions of 28 Dec 2009, Section 6.b.ii or Provisions of 12 Sep 2009 Section 6.b -- however, there's a paragraph with a matching beginning. Boilerplate error? (You're using the IETF Trust Provisions' Section 6.b License Notice from 12 Feb 2009 rather than one of the newer Notices. See https://trustee.ietf.org/license-info/.) Checking nits according to https://www.ietf.org/id-info/1id-guidelines.txt: ---------------------------------------------------------------------------- No issues found here. Checking nits according to https://www.ietf.org/id-info/checklist : ---------------------------------------------------------------------------- ** The abstract seems to contain references ([2], [1]), which it shouldn't. Please replace those with straight textual mentions of the documents in question. Miscellaneous warnings: ---------------------------------------------------------------------------- == The copyright year in the IETF Trust and authors Copyright Line does not match the current year -- The document seems to lack a disclaimer for pre-RFC5378 work, but may have content which was first submitted before 10 November 2008. If you have contacted all the original authors and they are all willing to grant the BCP78 rights to the IETF Trust, then this is fine, and you can ignore this comment. If not, you may need to add the pre-RFC5378 disclaimer. (See the Legal Provisions document at https://trustee.ietf.org/license-info for more information.) -- The document date (October 4, 2009) is 5318 days in the past. Is this intentional? Checking references for intended status: Proposed Standard ---------------------------------------------------------------------------- (See RFCs 3967 and 4897 for information about using normative references to lower-maturity documents in RFCs) -- Possible downref: Non-RFC (?) normative reference: ref. 'ISO-8859-1' ** Obsolete normative reference: RFC 2616 (Obsoleted by RFC 7230, RFC 7231, RFC 7232, RFC 7233, RFC 7234, RFC 7235) Summary: 3 errors (**), 0 flaws (~~), 1 warning (==), 3 comments (--). Run idnits with the --verbose option for more detailed information about the items above. -------------------------------------------------------------------------------- 2 Network Working Group J. Reschke 3 Internet-Draft greenbytes 4 Intended status: Standards Track October 4, 2009 5 Expires: April 7, 2010 7 Application of RFC 2231 Encoding to 8 Hypertext Transfer Protocol (HTTP) Headers 9 draft-reschke-rfc2231-in-http-04 11 Status of this Memo 13 This Internet-Draft is submitted to IETF in full conformance with the 14 provisions of BCP 78 and BCP 79. 16 Internet-Drafts are working documents of the Internet Engineering 17 Task Force (IETF), its areas, and its working groups. Note that 18 other groups may also distribute working documents as Internet- 19 Drafts. 21 Internet-Drafts are draft documents valid for a maximum of six months 22 and may be updated, replaced, or obsoleted by other documents at any 23 time. It is inappropriate to use Internet-Drafts as reference 24 material or to cite them other than as "work in progress." 26 The list of current Internet-Drafts can be accessed at 27 http://www.ietf.org/ietf/1id-abstracts.txt. 29 The list of Internet-Draft Shadow Directories can be accessed at 30 http://www.ietf.org/shadow.html. 32 This Internet-Draft will expire on April 7, 2010. 34 Copyright Notice 36 Copyright (c) 2009 IETF Trust and the persons identified as the 37 document authors. All rights reserved. 39 This document is subject to BCP 78 and the IETF Trust's Legal 40 Provisions Relating to IETF Documents in effect on the date of 41 publication of this document (http://trustee.ietf.org/license-info). 42 Please review these documents carefully, as they describe your rights 43 and restrictions with respect to this document. 45 Abstract 47 By default, message header parameters in Hypertext Transfer Protocol 48 (HTTP) messages can not carry characters outside the ISO-8859-1 49 character set. RFC 2231 defines an escaping mechanism for use in 50 Multipurpose Internet Mail Extensions (MIME) headers. This document 51 specifies a profile of that encoding suitable for use in HTTP. 53 Editorial Note (To be removed by RFC Editor before publication) 55 There are multiple HTTP headers that already use RFC 2231 encoding in 56 practice (Content-Disposition) or might use it in the future (Link). 57 The purpose of this document is to provide a single place where the 58 generic aspects of RFC 2231 encoding in HTTP headers are defined. 60 Distribution of this document is unlimited. Although this is not a 61 work item of the HTTPbis Working Group, comments should be sent to 62 the Hypertext Transfer Protocol (HTTP) mailing list at 63 ietf-http-wg@w3.org [1], which may be joined by sending a message 64 with subject "subscribe" to ietf-http-wg-request@w3.org [2]. 66 Discussions of the HTTPbis Working Group are archived at 67 . 69 XML versions, latest edits and the issues list for this document are 70 available from 71 . A 72 collection of test cases is available at 73 . 75 Table of Contents 77 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . . 4 78 2. Notational Conventions . . . . . . . . . . . . . . . . . . . . 4 79 3. A Profile of RFC 2231 for Use in HTTP . . . . . . . . . . . . 4 80 3.1. Parameter Continuations . . . . . . . . . . . . . . . . . 4 81 3.2. Parameter Value Character Set and Language Information . . 5 82 3.2.1. Examples . . . . . . . . . . . . . . . . . . . . . . . 7 83 3.3. Language specification in Encoded Words . . . . . . . . . 7 84 4. Guidelines for Usage in HTTP Header Definitions . . . . . . . 8 85 4.1. When to Use the Extension . . . . . . . . . . . . . . . . 8 86 4.2. Error Handling . . . . . . . . . . . . . . . . . . . . . . 8 87 4.3. Using Multiple Instances for Internationalization . . . . 9 88 5. Security Considerations . . . . . . . . . . . . . . . . . . . 9 89 6. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 9 90 7. Acknowledgements . . . . . . . . . . . . . . . . . . . . . . . 9 91 8. References . . . . . . . . . . . . . . . . . . . . . . . . . . 9 92 8.1. Normative References . . . . . . . . . . . . . . . . . . . 9 93 8.2. Informative References . . . . . . . . . . . . . . . . . . 10 94 Appendix A. Change Log (to be removed by RFC Editor before 95 publication) . . . . . . . . . . . . . . . . . . . . 11 96 A.1. Since draft-reschke-rfc2231-in-http-00 . . . . . . . . . . 11 97 A.2. Since draft-reschke-rfc2231-in-http-01 . . . . . . . . . . 11 98 A.3. Since draft-reschke-rfc2231-in-http-02 . . . . . . . . . . 11 99 A.4. Since draft-reschke-rfc2231-in-http-03 . . . . . . . . . . 11 100 Appendix B. Resolved issues (to be removed by RFC Editor 101 before publication) . . . . . . . . . . . . . . . . . 11 102 B.1. charsetmatch . . . . . . . . . . . . . . . . . . . . . . . 11 103 Appendix C. Open issues (to be removed by RFC Editor prior to 104 publication) . . . . . . . . . . . . . . . . . . . . 11 105 C.1. edit . . . . . . . . . . . . . . . . . . . . . . . . . . . 12 106 Author's Address . . . . . . . . . . . . . . . . . . . . . . . . . 12 108 1. Introduction 110 By default, message header parameters in HTTP ([RFC2616]) messages 111 can not carry characters outside the ISO-8859-1 character set 112 ([ISO-8859-1]). RFC 2231 ([RFC2231]) defines an escaping mechanism 113 for use in MIME headers. This document specifies a profile of that 114 encoding for use in HTTP. 116 2. Notational Conventions 118 The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", 119 "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this 120 document are to be interpreted as described in [RFC2119]. 122 This specification uses the ABNF (Augmented Backus-Naur Form) 123 notation defined in [RFC5234]. The following core rules are included 124 by reference, as defined in [RFC5234], Appendix B.1: ALPHA (letters), 125 DIGIT (decimal 0-9), HEXDIG (hexadecimal 0-9/A-F/a-f) and LWSP 126 (linear white space). 128 Note that this specification uses the term "character set" for 129 consistency with other IETF specifications such as RFC 2277 (see 130 [RFC2277], Section 3). A more accurate term would be "character 131 encoding" (a mapping of code points to octet sequences). 133 3. A Profile of RFC 2231 for Use in HTTP 135 RFC 2231 defines several extensions to MIME. The sections below 136 discuss if and how they apply to HTTP. 138 In short: 140 o Parameter Continuations aren't needed (Section 3.1), 142 o Character Set and Language Information are useful, therefore a 143 simple subset is specified (Section 3.2), and 145 o Language Specifications in Encoded Words aren't needed 146 (Section 3.3). 148 3.1. Parameter Continuations 150 Section 3 of [RFC2231] defines a mechanism that deals with the length 151 limitations that apply to MIME headers. These limitations do not 152 apply to HTTP ([RFC2616], Section 19.4.7). 154 Thus in HTTP, senders MUST NOT use parameter continuations, and 155 therefore recipients do not need to support them. 157 3.2. Parameter Value Character Set and Language Information 159 Section 4 of [RFC2231] specifies how to embed language information 160 into parameter values, and also how to encode non-ASCII characters, 161 dealing with restrictions both in MIME and HTTP header parameters. 163 However, RFC 2231 does not specify a mandatory-to-implement character 164 set, making it hard for senders to decide which character set to use. 165 Thus, recipients implementing this specification MUST support the 166 character sets "ISO-8859-1" [ISO-8859-1] and "UTF-8" [RFC3629]. 168 Furthermore, RFC 2231 allows leaving out the character set 169 information. The profile defined by this specification does not 170 allow that. 172 The syntax for parameters is defined in Section 3.6 of [RFC2616] 173 (with RFC 2616 implied LWS translated to RFC 5234 LWSP): 175 parameter = attribute LWSP "=" LWSP value 177 attribute = token 178 value = token / quoted-string 180 quoted-string = 181 token = 183 This specification extends the grammar to: 185 parameter = reg-parameter / ext-parameter 187 reg-parameter = attribute LWSP "=" LWSP value 189 ext-parameter = attribute "*" LWSP "=" LWSP ext-value 191 ext-value = charset "'" [ language ] "'" value-chars 192 ; extended-initial-value, 193 ; defined in [RFC2231], Section 7 195 charset = "UTF-8" / "ISO-8859-1" / ext-charset 197 ext-charset = token ; see IANA charset registry 198 ; () 200 language = 202 value-chars = *( pct-encoded / attr-char ) 204 pct-encoded = "%" HEXDIG HEXDIG 205 ; see [RFC3986], Section 2.1 207 attr-char = ALPHA / DIGIT 208 / "-" / "." / "_" / "~" / ":" 209 / "!" / "$" / "&" / "+" 211 Thus, a parameter is either regular parameter (reg-parameter), as 212 previously defined in Section 3.6 of [RFC2616], or an extended 213 parameter (ext-parameter). 215 Extended parameters are those where the left hand side of the 216 assignment ends with an asterisk character. 218 The value part of an extended parameter (ext-value) is a token that 219 consists of three parts: the REQUIRED character set name (charset), 220 the OPTIONAL language information (language), and a character 221 sequence representing the actual value (value-chars), separated by 222 single quote characters. Note that both character set names and 223 language tags are restricted to the US-ASCII character set, and are 224 matched case-insensitively (see [RFC2978], Section 2.3 and [RFC5646], 225 Section 2.1.1). 227 Inside the value part, characters not contained in attr-char are 228 encoded into an octet sequence using the specified character set. 229 That octet sequence then is percent-encoded as specified in Section 230 2.1 of [RFC3986]. 232 Producers MUST NOT use character sets other than "UTF-8" ([RFC3629]) 233 or ISO-8859-1 ([ISO-8859-1]). Extension character sets (ext-charset) 234 are reserved for future use. 236 3.2.1. Examples 238 Non-extended notation, using "token": 240 foo: bar; title=Economy 242 Non-extended notation, using "quoted-string": 244 foo: bar; title="US-$ rates" 246 Extended notation, using the unicode character U+00A3 (POUND SIGN): 248 foo: bar; title*=iso-8859-1'en'%A3%20rates 250 Note: the Unicode pound sign character U+00A3 was encoded using ISO- 251 8859-1 into the single octet A3, then percent-encoded. Also note 252 that the space character was encoded as %20, as it is not contained 253 in attr-char. 255 Extended notation, using the unicode characters U+00A3 (POUND SIGN) 256 and U+20AC (EURO SIGN): 258 foo: bar; title*=UTF-8''%c2%a3%20and%20%e2%82%ac%20rates 260 Note: the unicode pound sign character U+00A3 was encoded using UTF-8 261 into the octet sequence C2 A3, then percent-encoded. Likewise, the 262 unicode euro sign character U+20AC was encoded into the octet 263 sequence E2 82 AC, then percent-encoded. Also note that HEXDIG 264 allows both lower-case and upper-case character, so recipients must 265 understand both, and that the language information is optional, while 266 the character set is not. 268 3.3. Language specification in Encoded Words 270 Section 5 of [RFC2231] extends the encoding defined in [RFC2047] to 271 also support language specification in encoded words. Although the 272 HTTP/1.1 specification does refer to RFC 2047 ([RFC2616], Section 273 2.2), it's not clear to which header field exactly it applies, and 274 whether it is implemented in practice (see 275 for details). 277 Thus, the RFC 2231 profile defined by this specification does not 278 include this feature. 280 4. Guidelines for Usage in HTTP Header Definitions 282 Specifications of HTTP headers that use the extensions defined in 283 Section 3.2 should clearly state that. A simple way to achieve this 284 is to normatively reference this specification, and to include the 285 ext-value production into the ABNF for that header. 287 For instance: 289 foo-header = "foo" LWSP ":" LWSP token ";" LWSP title-param 290 title-param = "title" LWSP "=" LWSP value 291 / "title*" LWSP "=" LWSP ext-value 292 ext-value = 294 [[rfcno: Note to RFC Editor: in the figure above, please replace 295 "xxxx" by the RFC number assigned to this specification.]] 297 4.1. When to Use the Extension 299 Section 4.2 of [RFC2277] requires that protocol elements containing 300 text can carry language information. Thus, the ext-value production 301 should always be used when the parameter value is of textual nature. 303 Furthermore, the extension should also be used whenever the parameter 304 value needs to carry characters not present in the US-ASCII 305 ([USASCII]) character set (note that it would be unacceptable to 306 define a new parameter that would be restricted to a subset of the 307 Unicode character set). 309 4.2. Error Handling 311 Header specifications that include parameters should also specify 312 whether same-named parameters can occur multiple times. If 313 repetitions are not allowed (and this is believed to be the common 314 case), the specification should state whether regular or the extended 315 syntax takes precedence. In the latter case, this could be used by 316 producers to use both formats without breaking recipients that do not 317 understand the syntax. 319 Example: 321 foo: bar; title="EURO exchange rates"; 322 title*=utf-8''%e2%82%ac%20exchange%20rates 324 In this case, the sender provides an ASCII version of the title for 325 legacy recipients, but also includes an internationalized version for 326 recipients understanding this specification -- the latter obviously 327 should prefer the new syntax over the old one. 329 Note: at the time of this writing, many implementations failed to 330 ignore the form they do not understand, or prioritize the ASCII 331 form although the extended syntax was present. 333 4.3. Using Multiple Instances for Internationalization 335 It is expected that in many cases, internationalization of parameters 336 in response headers is implemented using server driven content 337 negotiation ([RFC2616], Section 12.1) using the Accept-Language 338 header ([RFC2616], Section 14.4). However, the format described in 339 this specification also allows to use multiple instances providing 340 multiple languages in a single header. Specifications that want to 341 take advantage of this should clearly specify the expected processing 342 by the recipient. 344 Example: 346 foo: bar; title*=utf-8'en'Document%20Title; 347 title*=utf-8'de'Titel%20des%20Dokuments 349 5. Security Considerations 351 This document does not discuss security issues and is not believed to 352 raise any security issues not already endemic in HTTP. 354 6. IANA Considerations 356 There are no IANA Considerations related to this specification. 358 7. Acknowledgements 360 Thanks to Frank Ellermann for help figuring out ABNF details, and to 361 Roar Lauritzsen for implementer's feedback. 363 8. References 365 8.1. Normative References 367 [ISO-8859-1] 368 International Organization for Standardization, 369 "Information technology -- 8-bit single-byte coded graphic 370 character sets -- Part 1: Latin alphabet No. 1", ISO/ 371 IEC 8859-1:1998, 1998. 373 [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate 374 Requirement Levels", BCP 14, RFC 2119, March 1997. 376 [RFC2616] Fielding, R., Gettys, J., Mogul, J., Frystyk, H., 377 Masinter, L., Leach, P., and T. Berners-Lee, "Hypertext 378 Transfer Protocol -- HTTP/1.1", RFC 2616, June 1999. 380 [RFC3629] Yergeau, F., "UTF-8, a transformation format of ISO 381 10646", RFC 3629, STD 63, November 2003. 383 [RFC5234] Crocker, D., Ed. and P. Overell, "Augmented BNF for Syntax 384 Specifications: ABNF", STD 68, RFC 5234, January 2008. 386 [RFC5646] Phillips, A., Ed. and M. Davis, Ed., "Tags for Identifying 387 Languages", BCP 47, RFC 5646, September 2009. 389 8.2. Informative References 391 [RFC2047] Moore, K., "MIME (Multipurpose Internet Mail Extensions) 392 Part Three: Message Header Extensions for Non-ASCII Text", 393 RFC 2047, November 1996. 395 [RFC2231] Freed, N. and K. Moore, "MIME Parameter Value and Encoded 396 Word Extensions: 397 Character Sets, Languages, and Continuations", RFC 2231, 398 November 1997. 400 [RFC2277] Alvestrand, H., "IETF Policy on Character Sets and 401 Languages", BCP 18, RFC 2277, January 1998. 403 [RFC2978] Freed, N. and J. Postel, "IANA Charset Registration 404 Procedures", BCP 19, RFC 2978, October 2000. 406 [RFC3986] Berners-Lee, T., Fielding, R., and L. Masinter, "Uniform 407 Resource Identifier (URI): Generic Syntax", RFC 3986, 408 STD 66, January 2005. 410 [USASCII] American National Standards Institute, "Coded Character 411 Set -- 7-bit American Standard Code for Information 412 Interchange", ANSI X3.4, 1986. 414 URIs 416 [1] 418 [2] 420 Appendix A. Change Log (to be removed by RFC Editor before publication) 422 A.1. Since draft-reschke-rfc2231-in-http-00 424 Use RFC5234-style ABNF, closer to the one used in RFC 2231. 426 Make RFC 2231 dependency informative, so this specification can 427 evolve independantly. 429 Explain the ABNF in prose. 431 A.2. Since draft-reschke-rfc2231-in-http-01 433 Remove unneeded RFC5137 notation (code point vs character). 435 A.3. Since draft-reschke-rfc2231-in-http-02 437 And and resolve issues "charset", "repeats" and "rfc4646". 439 A.4. Since draft-reschke-rfc2231-in-http-03 441 And and resolve issue "charsetmatch". 443 Appendix B. Resolved issues (to be removed by RFC Editor before 444 publication) 446 Issues that were either rejected or resolved in this version of this 447 document. 449 B.1. charsetmatch 451 In Section 3.2: 453 Type: change 455 julian.reschke@greenbytes.de (2009-10-03): Is the character set name 456 matched case-sensitively? 458 Resolution (2009-10-04): Be consistent with 459 http://www.iana.org/assignments/character-sets and match case- 460 insensitively. 462 Appendix C. Open issues (to be removed by RFC Editor prior to 463 publication) 465 C.1. edit 467 Type: edit 469 julian.reschke@greenbytes.de (2009-04-17): Umbrella issue for 470 editorial fixes/enhancements. 472 Author's Address 474 Julian F. Reschke 475 greenbytes GmbH 476 Hafenweg 16 477 Muenster, NW 48155 478 Germany 480 Email: julian.reschke@greenbytes.de 481 URI: http://greenbytes.de/tech/webdav/