Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3)

Side by Side Diff: pkg/http_server/lib/src/http_multipart_form_data_impl.dart

Issue 26973004: Preserve '\' in filenames for uploads, as Windows/IE contains them. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | pkg/http_server/test/http_multipart_test.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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 }
OLDNEW
« no previous file with comments | « no previous file | pkg/http_server/test/http_multipart_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698