OLD | NEW |
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
4 | 4 |
5 part of http_server; | 5 part of http_server; |
6 | 6 |
7 | 7 |
8 class _HttpMultipartFormData extends Stream implements HttpMultipartFormData { | 8 class _HttpMultipartFormData extends Stream implements HttpMultipartFormData { |
9 final ContentType contentType; | 9 final ContentType contentType; |
10 final HeaderValue contentDisposition; | 10 final HeaderValue contentDisposition; |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
65 switch (key) { | 65 switch (key) { |
66 case 'content-type': | 66 case 'content-type': |
67 type = ContentType.parse(multipart.headers[key]); | 67 type = ContentType.parse(multipart.headers[key]); |
68 break; | 68 break; |
69 | 69 |
70 case 'content-transfer-encoding': | 70 case 'content-transfer-encoding': |
71 encoding = HeaderValue.parse(multipart.headers[key]); | 71 encoding = HeaderValue.parse(multipart.headers[key]); |
72 break; | 72 break; |
73 | 73 |
74 case 'content-disposition': | 74 case 'content-disposition': |
75 disposition = HeaderValue.parse(multipart.headers[key]); | 75 disposition = HeaderValue.parse(multipart.headers[key], |
| 76 preserveBackslash: true); |
76 break; | 77 break; |
77 | 78 |
78 default: | 79 default: |
79 remaining[key] = multipart.headers[key]; | 80 remaining[key] = multipart.headers[key]; |
80 break; | 81 break; |
81 } | 82 } |
82 } | 83 } |
83 if (disposition == null) { | 84 if (disposition == null) { |
84 throw new HttpException( | 85 throw new HttpException( |
85 "Mime Multipart doesn't contain a Content-Disposition header value"); | 86 "Mime Multipart doesn't contain a Content-Disposition header value"); |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
132 while ((amp = input.indexOf('&', offset)) >= 0) { | 133 while ((amp = input.indexOf('&', offset)) >= 0) { |
133 buffer.write(input.substring(offset, amp)); | 134 buffer.write(input.substring(offset, amp)); |
134 int end = input.indexOf(';', amp); | 135 int end = input.indexOf(';', amp); |
135 parse(amp, end); | 136 parse(amp, end); |
136 offset = end + 1; | 137 offset = end + 1; |
137 } | 138 } |
138 buffer.write(input.substring(offset)); | 139 buffer.write(input.substring(offset)); |
139 return buffer.toString(); | 140 return buffer.toString(); |
140 } | 141 } |
141 } | 142 } |
OLD | NEW |