1 | |
---|
2 | |
---|
3 | |
---|
4 | HTTPbis Working Group J. Reschke |
---|
5 | Internet-Draft greenbytes |
---|
6 | Updates: 2616 (if approved) October 25, 2010 |
---|
7 | Intended status: Standards Track |
---|
8 | Expires: April 28, 2011 |
---|
9 | |
---|
10 | |
---|
11 | Use of the Content-Disposition Header Field in the |
---|
12 | Hypertext Transfer Protocol (HTTP) |
---|
13 | draft-ietf-httpbis-content-disp-03 |
---|
14 | |
---|
15 | Abstract |
---|
16 | |
---|
17 | HTTP/1.1 defines the Content-Disposition response header field, but |
---|
18 | points out that it is not part of the HTTP/1.1 Standard. This |
---|
19 | specification takes over the definition and registration of Content- |
---|
20 | Disposition, as used in HTTP, and clarifies internationalization |
---|
21 | aspects. |
---|
22 | |
---|
23 | Editorial Note (To be removed by RFC Editor before publication) |
---|
24 | |
---|
25 | This specification is expected to replace the definition of Content- |
---|
26 | Disposition in the HTTP/1.1 specification, as currently revised by |
---|
27 | the IETF HTTPbis working group. See also |
---|
28 | <http://trac.tools.ietf.org/wg/httpbis/trac/ticket/123>. |
---|
29 | |
---|
30 | Discussion of this draft should take place on the HTTPBIS working |
---|
31 | group mailing list (ietf-http-wg@w3.org). The current issues list is |
---|
32 | at <http://trac.tools.ietf.org/wg/httpbis/trac/ |
---|
33 | query?component=content-disp> and related documents (including fancy |
---|
34 | diffs) can be found at <http://tools.ietf.org/wg/httpbis/>. |
---|
35 | |
---|
36 | The changes in this draft are summarized in Appendix D.7. |
---|
37 | |
---|
38 | Status of This Memo |
---|
39 | |
---|
40 | This Internet-Draft is submitted in full conformance with the |
---|
41 | provisions of BCP 78 and BCP 79. |
---|
42 | |
---|
43 | Internet-Drafts are working documents of the Internet Engineering |
---|
44 | Task Force (IETF). Note that other groups may also distribute |
---|
45 | working documents as Internet-Drafts. The list of current Internet- |
---|
46 | Drafts is at http://datatracker.ietf.org/drafts/current/. |
---|
47 | |
---|
48 | Internet-Drafts are draft documents valid for a maximum of six months |
---|
49 | and may be updated, replaced, or obsoleted by other documents at any |
---|
50 | time. It is inappropriate to use Internet-Drafts as reference |
---|
51 | material or to cite them other than as "work in progress." |
---|
52 | |
---|
53 | |
---|
54 | |
---|
55 | Reschke Expires April 28, 2011 [Page 1] |
---|
56 | |
---|
57 | Internet-Draft Content-Disposition in HTTP October 2010 |
---|
58 | |
---|
59 | |
---|
60 | This Internet-Draft will expire on April 28, 2011. |
---|
61 | |
---|
62 | Copyright Notice |
---|
63 | |
---|
64 | Copyright (c) 2010 IETF Trust and the persons identified as the |
---|
65 | document authors. All rights reserved. |
---|
66 | |
---|
67 | This document is subject to BCP 78 and the IETF Trust's Legal |
---|
68 | Provisions Relating to IETF Documents |
---|
69 | (http://trustee.ietf.org/license-info) in effect on the date of |
---|
70 | publication of this document. Please review these documents |
---|
71 | carefully, as they describe your rights and restrictions with respect |
---|
72 | to this document. Code Components extracted from this document must |
---|
73 | include Simplified BSD License text as described in Section 4.e of |
---|
74 | the Trust Legal Provisions and are provided without warranty as |
---|
75 | described in the Simplified BSD License. |
---|
76 | |
---|
77 | |
---|
78 | |
---|
79 | |
---|
80 | |
---|
81 | |
---|
82 | |
---|
83 | |
---|
84 | |
---|
85 | |
---|
86 | |
---|
87 | |
---|
88 | |
---|
89 | |
---|
90 | |
---|
91 | |
---|
92 | |
---|
93 | |
---|
94 | |
---|
95 | |
---|
96 | |
---|
97 | |
---|
98 | |
---|
99 | |
---|
100 | |
---|
101 | |
---|
102 | |
---|
103 | |
---|
104 | |
---|
105 | |
---|
106 | |
---|
107 | |
---|
108 | |
---|
109 | |
---|
110 | |
---|
111 | Reschke Expires April 28, 2011 [Page 2] |
---|
112 | |
---|
113 | Internet-Draft Content-Disposition in HTTP October 2010 |
---|
114 | |
---|
115 | |
---|
116 | Table of Contents |
---|
117 | |
---|
118 | 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . . 4 |
---|
119 | 2. Notational Conventions . . . . . . . . . . . . . . . . . . . . 4 |
---|
120 | 3. Header Field Definition . . . . . . . . . . . . . . . . . . . 4 |
---|
121 | 3.1. Grammar . . . . . . . . . . . . . . . . . . . . . . . . . 5 |
---|
122 | 3.2. Disposition Type . . . . . . . . . . . . . . . . . . . . . 5 |
---|
123 | 3.3. Disposition Parameter: 'Filename' . . . . . . . . . . . . 5 |
---|
124 | 3.4. Disposition Parameter: Extensions . . . . . . . . . . . . 7 |
---|
125 | 3.5. Extensibility . . . . . . . . . . . . . . . . . . . . . . 7 |
---|
126 | 4. Examples . . . . . . . . . . . . . . . . . . . . . . . . . . . 7 |
---|
127 | 5. Internationalization Considerations . . . . . . . . . . . . . 8 |
---|
128 | 6. Security Considerations . . . . . . . . . . . . . . . . . . . 8 |
---|
129 | 7. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 8 |
---|
130 | 7.1. Registry for Disposition Values and Parameter . . . . . . 8 |
---|
131 | 7.2. Header Field Registration . . . . . . . . . . . . . . . . 8 |
---|
132 | 8. Acknowledgements . . . . . . . . . . . . . . . . . . . . . . . 9 |
---|
133 | 9. References . . . . . . . . . . . . . . . . . . . . . . . . . . 9 |
---|
134 | 9.1. Normative References . . . . . . . . . . . . . . . . . . . 9 |
---|
135 | 9.2. Informative References . . . . . . . . . . . . . . . . . . 9 |
---|
136 | Appendix A. Changes from the RFC 2616 Definition . . . . . . . . 10 |
---|
137 | Appendix B. Differences compared to RFC 2183 . . . . . . . . . . 10 |
---|
138 | Appendix C. Alternative Approaches to Internationalization . . . 11 |
---|
139 | C.1. RFC 2047 Encoding . . . . . . . . . . . . . . . . . . . . 11 |
---|
140 | C.2. Percent Encoding . . . . . . . . . . . . . . . . . . . . . 11 |
---|
141 | C.3. Encoding Sniffing . . . . . . . . . . . . . . . . . . . . 12 |
---|
142 | C.4. Implementations (to be removed by RFC Editor before |
---|
143 | publication) . . . . . . . . . . . . . . . . . . . . . . . 12 |
---|
144 | Appendix D. Change Log (to be removed by RFC Editor before |
---|
145 | publication) . . . . . . . . . . . . . . . . . . . . 12 |
---|
146 | D.1. Since draft-reschke-rfc2183-in-http-00 . . . . . . . . . . 12 |
---|
147 | D.2. Since draft-reschke-rfc2183-in-http-01 . . . . . . . . . . 13 |
---|
148 | D.3. Since draft-reschke-rfc2183-in-http-02 . . . . . . . . . . 13 |
---|
149 | D.4. Since draft-reschke-rfc2183-in-http-03 . . . . . . . . . . 13 |
---|
150 | D.5. Since draft-ietf-httpbis-content-disp-00 . . . . . . . . . 13 |
---|
151 | D.6. Since draft-ietf-httpbis-content-disp-01 . . . . . . . . . 13 |
---|
152 | D.7. Since draft-ietf-httpbis-content-disp-02 . . . . . . . . . 13 |
---|
153 | Index . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14 |
---|
154 | |
---|
155 | |
---|
156 | |
---|
157 | |
---|
158 | |
---|
159 | |
---|
160 | |
---|
161 | |
---|
162 | |
---|
163 | |
---|
164 | |
---|
165 | |
---|
166 | |
---|
167 | Reschke Expires April 28, 2011 [Page 3] |
---|
168 | |
---|
169 | Internet-Draft Content-Disposition in HTTP October 2010 |
---|
170 | |
---|
171 | |
---|
172 | 1. Introduction |
---|
173 | |
---|
174 | HTTP/1.1 defines the Content-Disposition response header field in |
---|
175 | Section 19.5.1 of [RFC2616], but points out that it is not part of |
---|
176 | the HTTP/1.1 Standard (Section 15.5): |
---|
177 | |
---|
178 | Content-Disposition is not part of the HTTP standard, but since it |
---|
179 | is widely implemented, we are documenting its use and risks for |
---|
180 | implementers. |
---|
181 | |
---|
182 | This specification takes over the definition and registration of |
---|
183 | Content-Disposition, as used in HTTP. Based on interoperability |
---|
184 | testing with existing User Agents, it fully defines a profile of the |
---|
185 | features defined in the Multipurpose Internet Mail Extensions (MIME) |
---|
186 | variant ([RFC2183]) of the header field, and also clarifies |
---|
187 | internationalization aspects. |
---|
188 | |
---|
189 | 2. Notational Conventions |
---|
190 | |
---|
191 | The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", |
---|
192 | "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this |
---|
193 | document are to be interpreted as described in [RFC2119]. |
---|
194 | |
---|
195 | This specification uses the augmented BNF notation defined in Section |
---|
196 | 2.1 of [RFC2616], including its rules for linear whitespace (LWS). |
---|
197 | |
---|
198 | 3. Header Field Definition |
---|
199 | |
---|
200 | The Content-Disposition response header field is used to convey |
---|
201 | additional information about how to process the response payload, and |
---|
202 | also can be used to attach additional metadata, such as the filename |
---|
203 | to use when saving the response payload locally. |
---|
204 | |
---|
205 | |
---|
206 | |
---|
207 | |
---|
208 | |
---|
209 | |
---|
210 | |
---|
211 | |
---|
212 | |
---|
213 | |
---|
214 | |
---|
215 | |
---|
216 | |
---|
217 | |
---|
218 | |
---|
219 | |
---|
220 | |
---|
221 | |
---|
222 | |
---|
223 | Reschke Expires April 28, 2011 [Page 4] |
---|
224 | |
---|
225 | Internet-Draft Content-Disposition in HTTP October 2010 |
---|
226 | |
---|
227 | |
---|
228 | 3.1. Grammar |
---|
229 | |
---|
230 | content-disposition = "Content-Disposition" ":" |
---|
231 | disposition-type *( ";" disposition-parm ) |
---|
232 | |
---|
233 | disposition-type = "inline" | "attachment" | disp-ext-type |
---|
234 | ; case-insensitive |
---|
235 | disp-ext-type = token |
---|
236 | |
---|
237 | disposition-parm = filename-parm | disp-ext-parm |
---|
238 | |
---|
239 | filename-parm = "filename" "=" value |
---|
240 | | "filename*" "=" ext-value |
---|
241 | |
---|
242 | disp-ext-parm = token "=" value |
---|
243 | | ext-token "=" ext-value |
---|
244 | ext-token = <the characters in token, followed by "*"> |
---|
245 | |
---|
246 | Defined in [RFC2616]: |
---|
247 | |
---|
248 | token = <token, defined in [RFC2616], Section 2.2> |
---|
249 | value = <value, defined in [RFC2616], Section 3.6> |
---|
250 | |
---|
251 | Defined in [RFC5987]: |
---|
252 | |
---|
253 | ext-value = <ext-value, defined in [RFC5987], Section 3.2> |
---|
254 | |
---|
255 | Parameter names MUST NOT be repeated; a header field value with |
---|
256 | multiple instances of the same parameter SHOULD be treated as |
---|
257 | invalid. |
---|
258 | |
---|
259 | 3.2. Disposition Type |
---|
260 | |
---|
261 | If the disposition type matches "attachment" (case-insensitively), |
---|
262 | this indicates that the user agent should prompt the user to save the |
---|
263 | response locally, rather than process it normally (as per its media |
---|
264 | type). |
---|
265 | |
---|
266 | On the other hand, if it matches "inline" (case-insensitively), this |
---|
267 | implies default processing. |
---|
268 | |
---|
269 | Unknown or unhandled disposition types SHOULD be handled the same way |
---|
270 | as "attachment" (see also [RFC2183], Section 2.8). |
---|
271 | |
---|
272 | 3.3. Disposition Parameter: 'Filename' |
---|
273 | |
---|
274 | The parameters "filename" and "filename*", to be matched case- |
---|
275 | insensitively, provide information on how to construct a filename for |
---|
276 | |
---|
277 | |
---|
278 | |
---|
279 | Reschke Expires April 28, 2011 [Page 5] |
---|
280 | |
---|
281 | Internet-Draft Content-Disposition in HTTP October 2010 |
---|
282 | |
---|
283 | |
---|
284 | storing the message payload. |
---|
285 | |
---|
286 | Depending on the disposition type, this information might be used |
---|
287 | right away (in the "save as..." interaction caused for the |
---|
288 | "attachment" disposition type), or later on (for instance, when the |
---|
289 | user decides to save the contents of the current page being |
---|
290 | displayed). |
---|
291 | |
---|
292 | The parameters "filename" and "filename*" differ only in that |
---|
293 | "filename*" uses the encoding defined in [RFC5987], allowing the use |
---|
294 | of characters not present in the ISO-8859-1 character set |
---|
295 | ([ISO-8859-1]). |
---|
296 | |
---|
297 | Many user agent implementations predating this specification do not |
---|
298 | understand the "filename*" parameter. Therefore, when both |
---|
299 | "filename" and "filename*" are present in a single header field |
---|
300 | value, recipients SHOULD pick "filename*" and ignore "filename". |
---|
301 | This way, senders can avoid special-casing specific user agents by |
---|
302 | sending both the more expressive "filename*" parameter, and the |
---|
303 | "filename" parameter as fallback for legacy recipients (see Section 4 |
---|
304 | for an example). |
---|
305 | |
---|
306 | It is essential that user agents treat the specified filename as |
---|
307 | advisory only, thus be very careful in extracting the desired |
---|
308 | information. In particular: |
---|
309 | |
---|
310 | o When the value contains path separator characters, all but the |
---|
311 | last segment SHOULD be ignored. This prevents unintentional |
---|
312 | overwriting of well-known file system location (such as "/etc/ |
---|
313 | passwd"). |
---|
314 | |
---|
315 | o Many platforms do not use Internet Media Types ([RFC2046]) to hold |
---|
316 | type information in the file system, but rely on filename |
---|
317 | extensions instead. Trusting the server-provided file extension |
---|
318 | could introduce a privilege escalation when the saved file is |
---|
319 | later opened (consider ".exe"). Thus, recipients need to ensure |
---|
320 | that a file extension is used that is safe, optimally matching the |
---|
321 | media type of the received payload. |
---|
322 | |
---|
323 | o Recipients are advised to strip or replace character sequences |
---|
324 | that are known to cause confusion both in user interfaces and in |
---|
325 | filenames, such as control characters and leading and trailing |
---|
326 | whitespace. |
---|
327 | |
---|
328 | o Other aspects recipients need to be aware of are names that have a |
---|
329 | special meaning in the file system or in shell commands, such as |
---|
330 | "." and "..", "~", "|", and also device names. |
---|
331 | |
---|
332 | |
---|
333 | |
---|
334 | |
---|
335 | Reschke Expires April 28, 2011 [Page 6] |
---|
336 | |
---|
337 | Internet-Draft Content-Disposition in HTTP October 2010 |
---|
338 | |
---|
339 | |
---|
340 | Note: Many user agents do not properly handle escape characters |
---|
341 | when using the quoted-string form. Furthermore, some user agents |
---|
342 | erroneously try to perform unescaping of "percent" escapes (see |
---|
343 | Appendix C.2), and thus might misinterpret filenames containing |
---|
344 | the percent character followed by two hex digits. |
---|
345 | |
---|
346 | 3.4. Disposition Parameter: Extensions |
---|
347 | |
---|
348 | To enable future extensions, unknown parameters SHOULD be ignored |
---|
349 | (see also [RFC2183], Section 2.8). |
---|
350 | |
---|
351 | 3.5. Extensibility |
---|
352 | |
---|
353 | Note that Section 9 of [RFC2183] defines IANA registries both for |
---|
354 | disposition types and disposition parameters. This registry is |
---|
355 | shared by different protocols using Content-Disposition, such as MIME |
---|
356 | and HTTP. Therefore, not all registered values may make sense in the |
---|
357 | context of HTTP. |
---|
358 | |
---|
359 | 4. Examples |
---|
360 | |
---|
361 | Direct UA to show "save as" dialog, with a filename of |
---|
362 | "example.html": |
---|
363 | |
---|
364 | Content-Disposition: Attachment; filename=example.html |
---|
365 | |
---|
366 | Direct UA to behave as if the Content-Disposition header field wasn't |
---|
367 | present, but to remember the filename "example.html" for a subsequent |
---|
368 | save operation: |
---|
369 | |
---|
370 | Content-Disposition: INLINE; FILENAME= "example.html" |
---|
371 | |
---|
372 | Direct UA to show "save as" dialog, with a filename of "an example": |
---|
373 | |
---|
374 | Content-Disposition: Attachment; Filename*=UTF-8'en'an%20example |
---|
375 | |
---|
376 | Note that this example uses the extended encoding defined in |
---|
377 | [RFC5987] to specify that the natural language of the filename is |
---|
378 | English, and also to encode the space character which is not allowed |
---|
379 | in the token production. |
---|
380 | |
---|
381 | Direct UA to show "save as" dialog, with a filename containing the |
---|
382 | Unicode character U+20AC (EURO SIGN): |
---|
383 | |
---|
384 | Content-Disposition: attachment; |
---|
385 | filename*= UTF-8''%e2%82%ac%20rates |
---|
386 | |
---|
387 | Here, the encoding defined in [RFC5987] is also used to encode the |
---|
388 | |
---|
389 | |
---|
390 | |
---|
391 | Reschke Expires April 28, 2011 [Page 7] |
---|
392 | |
---|
393 | Internet-Draft Content-Disposition in HTTP October 2010 |
---|
394 | |
---|
395 | |
---|
396 | non-ISO-8859-1 character. |
---|
397 | |
---|
398 | Same as above, but adding the "filename" parameter for compatibility |
---|
399 | with user agents not implementing RFC 5987: |
---|
400 | |
---|
401 | Content-Disposition: attachment; |
---|
402 | filename="EURO rates"; |
---|
403 | filename*=utf-8''%e2%82%ac%20rates |
---|
404 | |
---|
405 | Note: as of October 2010, those user agents that do not support the |
---|
406 | RFC 5987 encoding ignore "filename*" when it occurs after "filename". |
---|
407 | Unfortunately, some user agents that do support RFC 5987 do pick the |
---|
408 | "filename" rather than the "filename*" parameter when it occurs |
---|
409 | first; it is expected that this situation is going to improve soon. |
---|
410 | |
---|
411 | 5. Internationalization Considerations |
---|
412 | |
---|
413 | The "filename*" parameter (Section 3.3), using the encoding defined |
---|
414 | in [RFC5987], allows the server to transmit characters outside the |
---|
415 | ISO-8859-1 character set, and also to optionally specify the language |
---|
416 | in use. |
---|
417 | |
---|
418 | Future parameters might also require internationalization, in which |
---|
419 | case the same encoding can be used. |
---|
420 | |
---|
421 | 6. Security Considerations |
---|
422 | |
---|
423 | Using server-supplied information for constructing local filenames |
---|
424 | introduces many risks. These are summarized in Section 3.3. |
---|
425 | |
---|
426 | Furthermore, implementers also ought to be aware of the Security |
---|
427 | Considerations applying to HTTP (see Section 15 of [RFC2616]), and |
---|
428 | also the parameter encoding defined in [RFC5987] (see Section 5). |
---|
429 | |
---|
430 | 7. IANA Considerations |
---|
431 | |
---|
432 | 7.1. Registry for Disposition Values and Parameter |
---|
433 | |
---|
434 | This specification does not introduce any changes to the registration |
---|
435 | procedures for disposition values and parameters that are defined in |
---|
436 | Section 9 of [RFC2183]. |
---|
437 | |
---|
438 | 7.2. Header Field Registration |
---|
439 | |
---|
440 | This document updates the definition of the Content-Disposition HTTP |
---|
441 | header field in the permanent HTTP header field registry (see |
---|
442 | [RFC3864]). |
---|
443 | |
---|
444 | |
---|
445 | |
---|
446 | |
---|
447 | Reschke Expires April 28, 2011 [Page 8] |
---|
448 | |
---|
449 | Internet-Draft Content-Disposition in HTTP October 2010 |
---|
450 | |
---|
451 | |
---|
452 | Header field name: Content-Disposition |
---|
453 | |
---|
454 | Applicable protocol: http |
---|
455 | |
---|
456 | Status: standard |
---|
457 | |
---|
458 | Author/Change controller: IETF |
---|
459 | |
---|
460 | Specification document: this specification (Section 3) |
---|
461 | |
---|
462 | 8. Acknowledgements |
---|
463 | |
---|
464 | Thanks to Adam Barth, Rolf Eike Beer, Bjoern Hoehrmann, Alfred |
---|
465 | Hoenes, Roar Lauritzsen, Henrik Nordstrom, and Mark Nottingham for |
---|
466 | their valuable feedback. |
---|
467 | |
---|
468 | 9. References |
---|
469 | |
---|
470 | 9.1. Normative References |
---|
471 | |
---|
472 | [ISO-8859-1] International Organization for Standardization, |
---|
473 | "Information technology -- 8-bit single-byte coded |
---|
474 | graphic character sets -- Part 1: Latin alphabet No. |
---|
475 | 1", ISO/IEC 8859-1:1998, 1998. |
---|
476 | |
---|
477 | [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate |
---|
478 | Requirement Levels", BCP 14, RFC 2119, March 1997. |
---|
479 | |
---|
480 | [RFC2616] Fielding, R., Gettys, J., Mogul, J., Frystyk, H., |
---|
481 | Masinter, L., Leach, P., and T. Berners-Lee, "Hypertext |
---|
482 | Transfer Protocol -- HTTP/1.1", RFC 2616, June 1999. |
---|
483 | |
---|
484 | [RFC5987] Reschke, J., "Character Set and Language Encoding for |
---|
485 | Hypertext Transfer Protocol (HTTP) Header Field |
---|
486 | Parameters", RFC 5987, August 2010. |
---|
487 | |
---|
488 | 9.2. Informative References |
---|
489 | |
---|
490 | [RFC2046] Freed, N. and N. Borenstein, "Multipurpose Internet |
---|
491 | Mail Extensions (MIME) Part Two: Media Types", |
---|
492 | RFC 2046, November 1996. |
---|
493 | |
---|
494 | [RFC2047] Moore, K., "MIME (Multipurpose Internet Mail |
---|
495 | Extensions) Part Three: Message Header Extensions for |
---|
496 | Non-ASCII Text", RFC 2047, November 1996. |
---|
497 | |
---|
498 | [RFC2183] Troost, R., Dorner, S., and K. Moore, "Communicating |
---|
499 | Presentation Information in Internet Messages: The |
---|
500 | |
---|
501 | |
---|
502 | |
---|
503 | Reschke Expires April 28, 2011 [Page 9] |
---|
504 | |
---|
505 | Internet-Draft Content-Disposition in HTTP October 2010 |
---|
506 | |
---|
507 | |
---|
508 | Content-Disposition Header Field", RFC 2183, |
---|
509 | August 1997. |
---|
510 | |
---|
511 | [RFC2231] Freed, N. and K. Moore, "MIME Parameter Value and |
---|
512 | Encoded Word Extensions: Character Sets, Languages, and |
---|
513 | Continuations", RFC 2231, November 1997. |
---|
514 | |
---|
515 | [RFC3629] Yergeau, F., "UTF-8, a transformation format of ISO |
---|
516 | 10646", STD 63, RFC 3629, November 2003. |
---|
517 | |
---|
518 | [RFC3864] Klyne, G., Nottingham, M., and J. Mogul, "Registration |
---|
519 | Procedures for Message Header Fields", BCP 90, |
---|
520 | RFC 3864, September 2004. |
---|
521 | |
---|
522 | [RFC3986] Berners-Lee, T., Fielding, R., and L. Masinter, |
---|
523 | "Uniform Resource Identifier (URI): Generic Syntax", |
---|
524 | STD 66, RFC 3986, January 2005. |
---|
525 | |
---|
526 | Appendix A. Changes from the RFC 2616 Definition |
---|
527 | |
---|
528 | Compared to Section 19.5.1 of [RFC2616], the following normative |
---|
529 | changes reflecting actual implementations have been made: |
---|
530 | |
---|
531 | o According to RFC 2616, the disposition type "attachment" only |
---|
532 | applies to content of type "application/octet-stream". This |
---|
533 | restriction has been removed, because user agents in practice do |
---|
534 | not check the content type, and it also discourages properly |
---|
535 | declaring the media type. |
---|
536 | |
---|
537 | o RFC 2616 only allows "quoted-string" for the filename parameter. |
---|
538 | This would be an exceptional parameter syntax, and also doesn't |
---|
539 | reflect actual use. |
---|
540 | |
---|
541 | o The definition for the disposition type "inline" ([RFC2183], |
---|
542 | Section 2.1) has been re-added with a suggestion for its |
---|
543 | processing. |
---|
544 | |
---|
545 | o This specification requires support for the extended parameter |
---|
546 | encoding defined in [RFC5987]. |
---|
547 | |
---|
548 | Appendix B. Differences compared to RFC 2183 |
---|
549 | |
---|
550 | Section 2 of [RFC2183] defines several additional disposition |
---|
551 | parameters: "creation-date", "modification-date", "quoted-date-time", |
---|
552 | and "size". These do not appear to be implemented by any user agent, |
---|
553 | thus have been omitted from this specification. |
---|
554 | |
---|
555 | |
---|
556 | |
---|
557 | |
---|
558 | |
---|
559 | Reschke Expires April 28, 2011 [Page 10] |
---|
560 | |
---|
561 | Internet-Draft Content-Disposition in HTTP October 2010 |
---|
562 | |
---|
563 | |
---|
564 | Appendix C. Alternative Approaches to Internationalization |
---|
565 | |
---|
566 | By default, HTTP header field parameters cannot carry characters |
---|
567 | outside the ISO-8859-1 ([ISO-8859-1]) character encoding (see |
---|
568 | [RFC2616], Section 2.2). For the "filename" parameter, this of |
---|
569 | course is an unacceptable restriction. |
---|
570 | |
---|
571 | Unfortunately, user agent implementers have not managed to come up |
---|
572 | with an interoperable approach, although the IETF Standards Track |
---|
573 | specifies exactly one solution ([RFC2231], clarified and profiled for |
---|
574 | HTTP in [RFC5987]). |
---|
575 | |
---|
576 | For completeness, the sections below describe the various approaches |
---|
577 | that have been tried, and explains how they are inferior to the RFC |
---|
578 | 5987 encoding used in this specification. |
---|
579 | |
---|
580 | C.1. RFC 2047 Encoding |
---|
581 | |
---|
582 | RFC 2047 defines an encoding mechanism for header fields, but this |
---|
583 | encoding is not supposed to be used for header field parameters - see |
---|
584 | Section 5 of [RFC2047]: |
---|
585 | |
---|
586 | An 'encoded-word' MUST NOT appear within a 'quoted-string'. |
---|
587 | |
---|
588 | ... |
---|
589 | |
---|
590 | An 'encoded-word' MUST NOT be used in parameter of a MIME Content- |
---|
591 | Type or Content-Disposition field, or in any structured field body |
---|
592 | except within a 'comment' or 'phrase'. |
---|
593 | |
---|
594 | In practice, some user agents implement the encoding, some do not |
---|
595 | (exposing the encoded string to the user), and some get confused by |
---|
596 | it. |
---|
597 | |
---|
598 | C.2. Percent Encoding |
---|
599 | |
---|
600 | Some user agents accept percent encoded ([RFC3986], Section 2.1) |
---|
601 | sequences of characters encoded using the UTF-8 ([RFC3629]) character |
---|
602 | encoding. |
---|
603 | |
---|
604 | In practice, this is hard to use because those user agents that do |
---|
605 | not support it will display the escaped character sequence to the |
---|
606 | user. |
---|
607 | |
---|
608 | Furthermore, the first user agent to implement this did choose the |
---|
609 | encoding based on local settings; thus making it very hard to use in |
---|
610 | multi-lingual environments. |
---|
611 | |
---|
612 | |
---|
613 | |
---|
614 | |
---|
615 | Reschke Expires April 28, 2011 [Page 11] |
---|
616 | |
---|
617 | Internet-Draft Content-Disposition in HTTP October 2010 |
---|
618 | |
---|
619 | |
---|
620 | C.3. Encoding Sniffing |
---|
621 | |
---|
622 | Some user agents inspect the value (which defaults to ISO-8859-1) and |
---|
623 | switch to UTF-8 when it seems to be more likely to be the correct |
---|
624 | interpretation. |
---|
625 | |
---|
626 | As with the approaches above, this is not interoperable and |
---|
627 | furthermore risks misinterpreting the actual value. |
---|
628 | |
---|
629 | C.4. Implementations (to be removed by RFC Editor before publication) |
---|
630 | |
---|
631 | Unfortunately, as of October 2010, neither the encoding defined in |
---|
632 | RFCs 2231 and 5987, nor any of the alternate approaches discussed |
---|
633 | above was implemented interoperably. Thus, this specification |
---|
634 | recommends the approach defined in RFC 5987, which at least has the |
---|
635 | advantage of actually being specified properly. |
---|
636 | |
---|
637 | The table below shows the implementation support for the various |
---|
638 | approaches: |
---|
639 | |
---|
640 | +---------------+------------+--------+--------------+--------------+ |
---|
641 | | User Agent | RFC | RFC | Percent | Encoding | |
---|
642 | | | 2231/5987 | 2047 | Encoding | Sniffing | |
---|
643 | +---------------+------------+--------+--------------+--------------+ |
---|
644 | | Chrome | no | yes | yes | yes | |
---|
645 | | Firefox | yes (*) | yes | no | yes | |
---|
646 | | Internet | no | no | yes | no | |
---|
647 | | Explorer | | | | | |
---|
648 | | Konqueror | yes | no | no | no | |
---|
649 | | Opera | yes | no | no | no | |
---|
650 | | Safari | no | no | no | yes | |
---|
651 | +---------------+------------+--------+--------------+--------------+ |
---|
652 | |
---|
653 | (*) Does not implement the fallback behavior to "filename" described |
---|
654 | in Section 3.3. |
---|
655 | |
---|
656 | Appendix D. Change Log (to be removed by RFC Editor before publication) |
---|
657 | |
---|
658 | Note: the issues names in the change log entries for |
---|
659 | draft-reschke-rfc2183-in-http refer to <http://greenbytes.de/tech/ |
---|
660 | webdav/draft-reschke-rfc2183-in-http-issues.html>. |
---|
661 | |
---|
662 | D.1. Since draft-reschke-rfc2183-in-http-00 |
---|
663 | |
---|
664 | Adjust terminology ("header" -> "header field"). Update rfc2231-in- |
---|
665 | http reference. |
---|
666 | |
---|
667 | |
---|
668 | |
---|
669 | |
---|
670 | |
---|
671 | Reschke Expires April 28, 2011 [Page 12] |
---|
672 | |
---|
673 | Internet-Draft Content-Disposition in HTTP October 2010 |
---|
674 | |
---|
675 | |
---|
676 | D.2. Since draft-reschke-rfc2183-in-http-01 |
---|
677 | |
---|
678 | Update rfc2231-in-http reference. Actually define the "filename" |
---|
679 | parameter. Add internationalization considerations. Add examples |
---|
680 | using the RFC 5987 encoding. Add overview over other approaches, |
---|
681 | plus a table reporting implementation status. Add and resolve issue |
---|
682 | "nodep2183". Add issues "asciivsiso", "deplboth", "quoted", and |
---|
683 | "registry". |
---|
684 | |
---|
685 | D.3. Since draft-reschke-rfc2183-in-http-02 |
---|
686 | |
---|
687 | Add and close issue "docfallback". Close issues "asciivsiso", |
---|
688 | "deplboth", "quoted", and "registry". |
---|
689 | |
---|
690 | D.4. Since draft-reschke-rfc2183-in-http-03 |
---|
691 | |
---|
692 | Updated to be a Working Draft of the IETF HTTPbis Working Group. |
---|
693 | |
---|
694 | D.5. Since draft-ietf-httpbis-content-disp-00 |
---|
695 | |
---|
696 | Closed issues: |
---|
697 | |
---|
698 | o <http://tools.ietf.org/wg/httpbis/trac/ticket/242>: "handling of |
---|
699 | unknown disposition types" |
---|
700 | |
---|
701 | Slightly updated the notes about the proposed fallback behavior. |
---|
702 | |
---|
703 | D.6. Since draft-ietf-httpbis-content-disp-01 |
---|
704 | |
---|
705 | Various editorial improvements. |
---|
706 | |
---|
707 | D.7. Since draft-ietf-httpbis-content-disp-02 |
---|
708 | |
---|
709 | Closed issues: |
---|
710 | |
---|
711 | o <http://tools.ietf.org/wg/httpbis/trac/ticket/244>: "state that |
---|
712 | repeating parameters are invalid" |
---|
713 | |
---|
714 | o <http://tools.ietf.org/wg/httpbis/trac/ticket/245>: "warn about |
---|
715 | %xx in filenames being misinterpreted" |
---|
716 | |
---|
717 | o <http://tools.ietf.org/wg/httpbis/trac/ticket/246>: "mention |
---|
718 | control chars when talking about postprecessing the filename |
---|
719 | parameter" |
---|
720 | |
---|
721 | Update Appendix C.4; Opera 10.63 RC implements the recommended |
---|
722 | fallback behavior. |
---|
723 | |
---|
724 | |
---|
725 | |
---|
726 | |
---|
727 | Reschke Expires April 28, 2011 [Page 13] |
---|
728 | |
---|
729 | Internet-Draft Content-Disposition in HTTP October 2010 |
---|
730 | |
---|
731 | |
---|
732 | Index |
---|
733 | |
---|
734 | C |
---|
735 | Content-Disposition header 4 |
---|
736 | |
---|
737 | H |
---|
738 | Headers |
---|
739 | Content-Disposition 4 |
---|
740 | |
---|
741 | Author's Address |
---|
742 | |
---|
743 | Julian F. Reschke |
---|
744 | greenbytes GmbH |
---|
745 | Hafenweg 16 |
---|
746 | Muenster, NW 48155 |
---|
747 | Germany |
---|
748 | |
---|
749 | EMail: julian.reschke@greenbytes.de |
---|
750 | URI: http://greenbytes.de/tech/webdav/ |
---|
751 | |
---|
752 | |
---|
753 | |
---|
754 | |
---|
755 | |
---|
756 | |
---|
757 | |
---|
758 | |
---|
759 | |
---|
760 | |
---|
761 | |
---|
762 | |
---|
763 | |
---|
764 | |
---|
765 | |
---|
766 | |
---|
767 | |
---|
768 | |
---|
769 | |
---|
770 | |
---|
771 | |
---|
772 | |
---|
773 | |
---|
774 | |
---|
775 | |
---|
776 | |
---|
777 | |
---|
778 | |
---|
779 | |
---|
780 | |
---|
781 | |
---|
782 | |
---|
783 | Reschke Expires April 28, 2011 [Page 14] |
---|
784 | |
---|