idnits 2.17.1 draft-reschke-rfc2183-in-http-02.txt: Checking boilerplate required by RFC 5378 and the IETF Trust (see https://trustee.ietf.org/license-info): ---------------------------------------------------------------------------- No issues found here. 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. -- The draft header indicates that this document updates RFC2616, but the abstract doesn't seem to mention this, which it should. Miscellaneous warnings: ---------------------------------------------------------------------------- == The copyright year in the IETF Trust and authors Copyright Line does not match the current year (Using the creation date from RFC2616, updated by this document, for RFC5378 checks: 1997-10-16) -- 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 (August 24, 2010) is 4986 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) ** Obsolete normative reference: RFC 2616 (Obsoleted by RFC 7230, RFC 7231, RFC 7232, RFC 7233, RFC 7234, RFC 7235) ** Obsolete normative reference: RFC 5987 (Obsoleted by RFC 8187) 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 Updates: 2616 (if approved) August 24, 2010 5 Intended status: Standards Track 6 Expires: February 25, 2011 8 Use of the Content-Disposition Header Field in the 9 Hypertext Transfer Protocol (HTTP) 10 draft-reschke-rfc2183-in-http-02 12 Abstract 14 HTTP/1.1 defines the Content-Disposition response header field, but 15 points out that it is not part of the HTTP/1.1 Standard. This 16 specification takes over the definition and registration of Content- 17 Disposition, as used in HTTP, and clarifies internationalization 18 aspects. 20 Editorial Note (To be removed by RFC Editor before publication) 22 This specification is expected to replace the definition of Content- 23 Disposition in the HTTP/1.1 specification, as currently revised by 24 the IETF HTTPbis working group. See also 25 . 27 Distribution of this document is unlimited. Although this is not a 28 work item of the HTTPbis Working Group, comments should be sent to 29 the Hypertext Transfer Protocol (HTTP) mailing list at 30 ietf-http-wg@w3.org [1], which may be joined by sending a message 31 with subject "subscribe" to ietf-http-wg-request@w3.org [2]. 33 Discussions of the HTTPbis Working Group are archived at 34 . 36 XML versions, latest edits and the issues list for this document are 37 available from 38 . A 39 collection of test cases is available at 40 . 42 Status of This Memo 44 This Internet-Draft is submitted in full conformance with the 45 provisions of BCP 78 and BCP 79. 47 Internet-Drafts are working documents of the Internet Engineering 48 Task Force (IETF). Note that other groups may also distribute 49 working documents as Internet-Drafts. The list of current Internet- 50 Drafts is at http://datatracker.ietf.org/drafts/current/. 52 Internet-Drafts are draft documents valid for a maximum of six months 53 and may be updated, replaced, or obsoleted by other documents at any 54 time. It is inappropriate to use Internet-Drafts as reference 55 material or to cite them other than as "work in progress." 57 This Internet-Draft will expire on February 25, 2011. 59 Copyright Notice 61 Copyright (c) 2010 IETF Trust and the persons identified as the 62 document authors. All rights reserved. 64 This document is subject to BCP 78 and the IETF Trust's Legal 65 Provisions Relating to IETF Documents 66 (http://trustee.ietf.org/license-info) in effect on the date of 67 publication of this document. Please review these documents 68 carefully, as they describe your rights and restrictions with respect 69 to this document. Code Components extracted from this document must 70 include Simplified BSD License text as described in Section 4.e of 71 the Trust Legal Provisions and are provided without warranty as 72 described in the Simplified BSD License. 74 Table of Contents 76 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . . 4 77 2. Notational Conventions . . . . . . . . . . . . . . . . . . . . 4 78 3. Header Field Definition . . . . . . . . . . . . . . . . . . . 4 79 3.1. Grammar . . . . . . . . . . . . . . . . . . . . . . . . . 4 80 3.2. Disposition Type . . . . . . . . . . . . . . . . . . . . . 5 81 3.3. Disposition Parameter: 'Filename' . . . . . . . . . . . . 5 82 3.4. Disposition Parameter: Extensions . . . . . . . . . . . . 6 83 4. Examples . . . . . . . . . . . . . . . . . . . . . . . . . . . 6 84 5. Internationalization Considerations . . . . . . . . . . . . . 7 85 6. Security Considerations . . . . . . . . . . . . . . . . . . . 7 86 7. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 7 87 7.1. Registry for Disposition Values and Parameter . . . . . . 7 88 7.2. Header Field Registration . . . . . . . . . . . . . . . . 7 89 8. Acknowledgements . . . . . . . . . . . . . . . . . . . . . . . 7 90 9. References . . . . . . . . . . . . . . . . . . . . . . . . . . 8 91 9.1. Normative References . . . . . . . . . . . . . . . . . . . 8 92 9.2. Informative References . . . . . . . . . . . . . . . . . . 8 93 Appendix A. Changes from the RFC 2616 Definition . . . . . . . . 9 94 Appendix B. Differences compared to RFC 2183 . . . . . . . . . . 9 95 Appendix C. Alternative Approaches to Internationalization . . . 9 96 C.1. RFC 2047 Encoding . . . . . . . . . . . . . . . . . . . . 10 97 C.2. Percent Encoding . . . . . . . . . . . . . . . . . . . . . 10 98 C.3. Encoding Sniffing . . . . . . . . . . . . . . . . . . . . 10 99 C.4. Implementations . . . . . . . . . . . . . . . . . . . . . 10 100 Appendix D. Change Log (to be removed by RFC Editor before 101 publication) . . . . . . . . . . . . . . . . . . . . 11 102 D.1. Since draft-reschke-rfc2183-in-http-00 . . . . . . . . . . 11 103 D.2. Since draft-reschke-rfc2183-in-http-01 . . . . . . . . . . 11 104 Appendix E. Resolved issues (to be removed by RFC Editor 105 before publication) . . . . . . . . . . . . . . . . . 11 106 E.1. nodep2183 . . . . . . . . . . . . . . . . . . . . . . . . 11 107 Appendix F. Open issues (to be removed by RFC Editor prior to 108 publication) . . . . . . . . . . . . . . . . . . . . 12 109 F.1. edit . . . . . . . . . . . . . . . . . . . . . . . . . . . 12 110 F.2. quoted . . . . . . . . . . . . . . . . . . . . . . . . . . 12 111 F.3. asciivsiso . . . . . . . . . . . . . . . . . . . . . . . . 12 112 F.4. deplboth . . . . . . . . . . . . . . . . . . . . . . . . . 12 113 F.5. registry . . . . . . . . . . . . . . . . . . . . . . . . . 12 114 Index . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13 116 1. Introduction 118 HTTP/1.1 defines the Content-Disposition response header field in 119 Section 19.5.1 of [RFC2616], but points out that it is not part of 120 the HTTP/1.1 Standard (Section 15.5): 122 Content-Disposition is not part of the HTTP standard, but since it 123 is widely implemented, we are documenting its use and risks for 124 implementors. 126 This specification takes over the definition and registration of 127 Content-Disposition, as used in HTTP. Based on interoperability 128 testing with existing User Agents, it fully defines a profile of the 129 features defined in the MIME variant ([RFC2183]) of the header field, 130 and also clarifies internationalization aspects. 132 2. Notational Conventions 134 The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", 135 "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this 136 document are to be interpreted as described in [RFC2119]. 138 This specification uses the augmented BNF notation defined in Section 139 2.1 of [RFC2616], including its rules for linear whitespace (LWS). 141 3. Header Field Definition 143 The Content-Disposition response header field is used to convey 144 additional information about how to process the response payload, and 145 also can be used to attach additional metadata, such as the filename. 147 3.1. Grammar 149 content-disposition = "Content-Disposition" ":" 150 disposition-type *( ";" disposition-parm ) 152 disposition-type = "inline" | "attachment" | disp-ext-type 153 ; case-insensitive 154 disp-ext-type = token 156 disposition-parm = filename-parm | disp-ext-parm 158 filename-parm = "filename" "=" value 159 | "filename*" "=" ext-value 161 disp-ext-parm = token "=" value 162 | ext-token "=" ext-value 163 ext-token = 165 Defined in [RFC2616]: 167 token = 168 value = 170 Defined in [RFC5987]: 172 ext-value = 174 3.2. Disposition Type 176 If the disposition type matches "attachment" (case-insensitively), 177 this indicates that the user agent should not display the response, 178 but directly enter a "save as..." dialog. 180 On the other hand, if it matches "inline" (case-insensitively), this 181 implies default processing. 183 Other disposition types SHOULD be handled the same way as 184 "attachment" (see also [RFC2183], Section 2.8). 186 3.3. Disposition Parameter: 'Filename' 188 The parameters "filename" and "filename*", to be matched case- 189 insensitively, provide information on how to construct a filename for 190 storing the message payload. 192 Depending on the disposition type, this information might be used 193 right away (in the "save as..." interaction caused for the 194 "attachment" disposition type), or later on (for instance, when the 195 user decides to save the contents of the current page being 196 displayed). 198 "filename" and "filename*" behave the same, except that "filename*" 199 uses the encoding defined in [RFC5987], allowing the use of non-ASCII 200 characters ([USASCII]). When both "filename" and "filename*" are 201 present, a recipient SHOULD pick "filename*" and ignore "filename" - 202 this will make it possible to send the same header value to clients 203 that do not support "filename". 205 It is essential that user agents treat the specified filename as 206 advisory only, thus be very careful in extracting the desired 207 information. In particular: 209 o When the value contains path separator characters, all but the 210 last segment SHOULD be ignored. This prevents unintentional 211 overwriting of well-known file system location (such as "/etc/ 212 passwd"). 214 o Many platforms do not use Internet Media Types ([RFC2046]) to hold 215 type information in the file system, but rely on filename 216 extensions instead. Trusting the server-provided file extension 217 could introduce a privilege escalation when later on the file is 218 opened locally (consider ".exe"). Thus, recipients need to ensure 219 that a file extension is used that is safe, optimally matching the 220 media type of the received payload. 222 o Other aspects recipients need to be aware of are names that have a 223 special meaning in the filesystem or in shell commands, such as 224 "." and "..", "~", "|", and also device names. 226 3.4. Disposition Parameter: Extensions 228 To enable future extensions, unknown parameters SHOULD be ignored 229 (see also [RFC2183], Section 2.8). 231 4. Examples 233 Direct UA to show "save as" dialog, with a filename of "foo.html": 235 Content-Disposition: Attachment; filename=foo.html 237 Direct UA to behave as if the Content-Disposition header field wasn't 238 present, but to remember the filename "foo.html" for a subsequent 239 save operation: 241 Content-Disposition: INLINE; FILENAME= "foo.html" 243 Direct UA to show "save as" dialog, with a filename of "an example": 245 Content-Disposition: Attachment; Filename*=UTF-8'en'an%20example 247 Note that this example uses the extended encoding defined in 248 [RFC5987] to specify that the natural language of the filename is 249 English, and also to encode the space character which is not allowed 250 in the token production. 252 Direct UA to show "save as" dialog, with a filename containing the 253 Unicode character U+20AC (EURO SIGN): 255 Content-Disposition: attachment; filename*= UTF-8''%e2%82%ac%20rates 257 Here, the encoding defined in [RFC5987] is also used to encode the 258 non-ASCII character. 260 5. Internationalization Considerations 262 The "filename*" parameter (Section 3.3), using the encoding defined 263 in [RFC5987], allows the server to transmit characters outside the 264 ASCII character set. 266 Future parameters might also require internationalization, in which 267 case the same encoding can be used. 269 6. Security Considerations 271 Using server-supplied information for constructing local filenames 272 introduces many risks. These are summarized in Section 3.3. 274 Furthermore, implementers also ought to be aware of the Security 275 Considerations applying to HTTP (see Section 15 of [RFC2616]), and 276 also the parameter encoding defined in [RFC5987] (see Section 5). 278 7. IANA Considerations 280 7.1. Registry for Disposition Values and Parameter 282 This specification does not introduce any changes to the registration 283 procedures for disposition values and parameters that are defined in 284 Section 9 of [RFC2183]. 286 7.2. Header Field Registration 288 This document updates the definition of the Content-Disposition HTTP 289 header field in the permanent HTTP header field registry (see 290 [RFC3864]). 292 Header field name: Content-Disposition 294 Applicable protocol: http 296 Status: standard 298 Author/Change controller: IETF 300 Specification document: this specification (Section 3) 302 8. Acknowledgements 304 Thanks to Rolf Eike Beer, Alfred Hoenes, and Roar Lauritzsen for 305 their valuable feedback. 307 9. References 308 9.1. Normative References 310 [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate 311 Requirement Levels", BCP 14, RFC 2119, March 1997. 313 [RFC2616] Fielding, R., Gettys, J., Mogul, J., Frystyk, H., 314 Masinter, L., Leach, P., and T. Berners-Lee, "Hypertext 315 Transfer Protocol -- HTTP/1.1", RFC 2616, June 1999. 317 [RFC5987] Reschke, J., "Applicability of RFC 2231 Encoding to 318 Hypertext Transfer Protocol (HTTP) Headers", RFC 5987, 319 August 2010. 321 9.2. Informative References 323 [ISO-8859-1] International Organization for Standardization, 324 "Information technology -- 8-bit single-byte coded 325 graphic character sets -- Part 1: Latin alphabet No. 326 1", ISO/IEC 8859-1:1998, 1998. 328 [RFC2046] Freed, N. and N. Borenstein, "Multipurpose Internet 329 Mail Extensions (MIME) Part Two: Media Types", 330 RFC 2046, November 1996. 332 [RFC2047] Moore, K., "MIME (Multipurpose Internet Mail 333 Extensions) Part Three: Message Header Extensions for 334 Non-ASCII Text", RFC 2047, November 1996. 336 [RFC2183] Troost, R., Dorner, S., and K. Moore, "Communicating 337 Presentation Information in Internet Messages: The 338 Content-Disposition Header Field", RFC 2183, 339 August 1997. 341 [RFC2231] Freed, N. and K. Moore, "MIME Parameter Value and 342 Encoded Word Extensions: Character Sets, Languages, and 343 Continuations", RFC 2231, November 1997. 345 [RFC3629] Yergeau, F., "UTF-8, a transformation format of ISO 346 10646", RFC 3629, STD 63, November 2003. 348 [RFC3864] Klyne, G., Nottingham, M., and J. Mogul, "Registration 349 Procedures for Message Header Fields", BCP 90, 350 RFC 3864, September 2004. 352 [RFC3986] Berners-Lee, T., Fielding, R., and L. Masinter, 353 "Uniform Resource Identifier (URI): Generic Syntax", 354 RFC 3986, STD 66, January 2005. 356 [USASCII] American National Standards Institute, "Coded Character 357 Set -- 7-bit American Standard Code for Information 358 Interchange", ANSI X3.4, 1986. 360 URIs 362 [1] 364 [2] 366 Appendix A. Changes from the RFC 2616 Definition 368 Compared to Section 19.5.1 of [RFC2616], the following normative 369 changes reflecting actual implementations have been made: 371 o According to RFC 2616, the disposition type "attachment" only 372 applies to content of type "application/octet-stream". This 373 restriction has been removed, because user agents in practice do 374 not check the content type, and it also discourages properly 375 declaring the media type. 377 o The definition for the disposition type "inline" ([RFC2183], 378 Section 2.1) has been re-added with a suggestion for its 379 processing. 381 o This specification requires support for the extended parameter 382 encoding defined in [RFC5987]. 384 Appendix B. Differences compared to RFC 2183 386 Section 2 of [RFC2183] defines several additional disposition 387 parameters: "creation-date", "modification-date", "quoted-date-time", 388 and "size". These do not appear to be implemented by any user agent, 389 thus have been omitted from this specification. 391 Appendix C. Alternative Approaches to Internationalization 393 By default, HTTP header field parameters cannot carry characters 394 outside the ISO-8859-1 ([ISO-8859-1]) character encoding (see 395 [RFC2616], Section 2.2). For the "filename" parameter, this of 396 course is an unacceptable restriction. 398 Unfortunately, user agent implementers have not managed to come up 399 with an interoperable approach, although the IETF Standards Track 400 specifies exactly one solution ([RFC2231], clarified and profiled for 401 HTTP in [RFC5987]). 403 For completeness, the sections below describe the various approaches 404 that have been tried, and explains how they are inferior to the RFC 405 5987 encoding used in this specification. 407 C.1. RFC 2047 Encoding 409 RFC 2047 defines an encoding mechanism for header fields, but this 410 encoding is not supposed to be used for header field parameters - see 411 Section 5 of [RFC2047]: 413 An 'encoded-word' MUST-NOT appear within a 'quoted-string'. 415 ... 417 An 'encoded-word' MUST NOT be used in parameter of a MIME Content- 418 Type or Content-Disposition field, or in any structured field body 419 except within a 'comment' or 'phrase'. 421 In practice, some user agents implement the encoding, some do not 422 (exposing the encoded string to the user), and some get confused by 423 it. 425 C.2. Percent Encoding 427 Some user agents accept percent encoded ([RFC3986], Section 2.1) 428 sequences of characters encoded using the UTF-8 ([RFC3629]) character 429 encoding. 431 In practice, this is hard to use because those user agents that do 432 not support it will display the escaped character sequence to the 433 user. 435 Furthermore, the first user agent to implement this did choose the 436 encoding based on local settings; thus making it very hard to use in 437 multi-lingual environments. 439 C.3. Encoding Sniffing 441 Some user agents inspect the value (which defaults to ISO-8859-1) and 442 switch to UTF-8 when it seems to be more likely to be the correct 443 interpretation. 445 As with the approaches above, this is not interoperable and 446 furthermore risks misinterpreting the actual value. 448 C.4. Implementations 450 The table below shows the various encoding approaches and for them in 451 released user agent versions as of August 2010, based on the test 452 cases published at . 454 +---------------+------------+--------+--------------+--------------+ 455 | User Agent | RFC | RFC | Percent | Encoding | 456 | | 2231/5987 | 2047 | Encoding | Sniffing | 457 +---------------+------------+--------+--------------+--------------+ 458 | Chrome | no | yes | yes | yes | 459 | Firefox | yes | yes | no | yes | 460 | Internet | no | no | yes | no | 461 | Explorer | | | | | 462 | Konqueror | yes | no | no | no | 463 | Opera | yes | no | no | no | 464 | Safari | no | no | no | yes | 465 +---------------+------------+--------+--------------+--------------+ 467 Appendix D. Change Log (to be removed by RFC Editor before publication) 469 D.1. Since draft-reschke-rfc2183-in-http-00 471 Adjust terminology ("header" -> "header field"). Update rfc2231-in- 472 http reference. 474 D.2. Since draft-reschke-rfc2183-in-http-01 476 Update rfc2231-in-http reference. Actually define the "filename" 477 parameter. Add internationalization considerations. Add examples 478 using the RFC 5987 encoding. Add overview over other approaches, 479 plus a table reporting implementation status. Add and resolve issue 480 "nodep2183". Add issues "asciivsiso", "deplboth", "quoted", and 481 "registry". 483 Appendix E. Resolved issues (to be removed by RFC Editor before 484 publication) 486 Issues that were either rejected or resolved in this version of this 487 document. 489 E.1. nodep2183 491 Type: change 493 julian.reschke@greenbytes.de (2010-08-23): Make sure we do not have a 494 normative dependency on RFC 2183. 496 Resolution (2010-08-23): Done. 498 Appendix F. Open issues (to be removed by RFC Editor prior to 499 publication) 501 F.1. edit 503 Type: edit 505 julian.reschke@greenbytes.de (2009-10-16): Umbrella issue for 506 editorial fixes/enhancements. 508 F.2. quoted 510 In Section 3.1: 512 Type: change 514 julian.reschke@greenbytes.de (2010-08-23): Can value be quoted-pair 515 as well? It is "value" only in RFC 2183, but "quoted-string" only in 516 2616. UAs seem to handle quoted-strings, although some have trouble 517 unescaping backslashes. 519 F.3. asciivsiso 521 In Section 3.3: 523 Type: change 525 julian.reschke@greenbytes.de (2010-08-24): We should be consistent 526 about what RFC 2616 defaults to (ASCII vs ISO-8859-1). 528 F.4. deplboth 530 In Section 4: 532 Type: change 534 julian.reschke@greenbytes.de (2010-08-24): Add an example that uses 535 both "filename" and "filename*" and mention current UA behavior. 537 F.5. registry 539 In Section 7.1: 541 Type: change 543 julian.reschke@greenbytes.de (2010-08-23): The registry technically 544 is for the MIME header, but has been used for C-D in other protocols 545 already. What's missing are instructions that new registrations 546 should state which protocol they're for. Do we want to attempt to 547 modify the registry? 549 Index 551 C 552 Content-Disposition header 4 554 H 555 Headers 556 Content-Disposition 4 558 Author's Address 560 Julian F. Reschke 561 greenbytes GmbH 562 Hafenweg 16 563 Muenster, NW 48155 564 Germany 566 EMail: julian.reschke@greenbytes.de 567 URI: http://greenbytes.de/tech/webdav/