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

Unified Diff: pkg/http_server/test/http_multipart_test.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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « pkg/http_server/lib/src/http_multipart_form_data_impl.dart ('k') | sdk/lib/io/http.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/http_server/test/http_multipart_test.dart
diff --git a/pkg/http_server/test/http_multipart_test.dart b/pkg/http_server/test/http_multipart_test.dart
index 10d695b15801c7e1ff27089e8e2a079418d3e255..d1d08434fcaa0c915e93550c34d42dce9e5ecb28 100644
--- a/pkg/http_server/test/http_multipart_test.dart
+++ b/pkg/http_server/test/http_multipart_test.dart
@@ -106,7 +106,6 @@ Content-Type: text/plain\r
Content of file\r
--AaB03x--\r\n''';
-
postDataTest(message.codeUnits,
'multipart/form-data',
'AaB03x',
@@ -115,6 +114,24 @@ Content of file\r
'Content of file',
contentType: 'text/plain',
filename: 'file1.txt')]);
+
+ // Windows/IE style file upload.
+ message = '''
+\r\n--AaB03x\r
+Content-Disposition: form-data; name="files"; filename="C:\\file1\\".txt"\r
+Content-Type: text/plain\r
+\r
+Content of file\r
+--AaB03x--\r\n''';
+
+
+ postDataTest(message.codeUnits,
+ 'multipart/form-data',
+ 'AaB03x',
+ [new FormField('files',
+ 'Content of file',
+ contentType: 'text/plain',
+ filename: 'C:\\file1".txt')]);
// Similar test using Chrome posting.
message = [
45, 45, 45, 45, 45, 45, 87, 101, 98, 75, 105, 116, 70, 111, 114, 109, 66,
« no previous file with comments | « pkg/http_server/lib/src/http_multipart_form_data_impl.dart ('k') | sdk/lib/io/http.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698