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

Side by Side Diff: sdk/lib/io/http_multipart_form_data_impl.dart

Issue 14660009: Implement support for application/x-www-form-urlencoded' form data in HttpBodyHandler. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Cleanup Created 7 years, 7 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 | « sdk/lib/io/http_body_impl.dart ('k') | sdk/lib/io/http_utils.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 dart.io; 5 part of dart.io;
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 23 matching lines...) Expand all
34 StringBuffer buffer = new StringBuffer(); 34 StringBuffer buffer = new StringBuffer();
35 Encoding encoding; 35 Encoding encoding;
36 if (contentType != null) { 36 if (contentType != null) {
37 encoding = Encoding.fromName(contentType.charset); 37 encoding = Encoding.fromName(contentType.charset);
38 } 38 }
39 if (encoding == null) encoding = Encoding.ISO_8859_1; 39 if (encoding == null) encoding = Encoding.ISO_8859_1;
40 _stream = _stream 40 _stream = _stream
41 .transform(new StringDecoder(encoding)) 41 .transform(new StringDecoder(encoding))
42 .expand((data) { 42 .expand((data) {
43 buffer.write(data); 43 buffer.write(data);
44 var out = _HttpUtils.parseHttpEntityString(buffer.toString()); 44 var out = _HttpUtils.decodeHttpEntityString(buffer.toString());
45 if (out != null) { 45 if (out != null) {
46 buffer = new StringBuffer(); 46 buffer = new StringBuffer();
47 return [out]; 47 return [out];
48 } 48 }
49 return const []; 49 return const [];
50 }); 50 });
51 } 51 }
52 } 52 }
53 53
54 bool get isText => _isText; 54 bool get isText => _isText;
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
93 onDone: onDone, 93 onDone: onDone,
94 onError: onError, 94 onError: onError,
95 cancelOnError: cancelOnError); 95 cancelOnError: cancelOnError);
96 } 96 }
97 97
98 String value(String name) { 98 String value(String name) {
99 return _mimeMultipart.headers[name]; 99 return _mimeMultipart.headers[name];
100 } 100 }
101 } 101 }
102 102
OLDNEW
« no previous file with comments | « sdk/lib/io/http_body_impl.dart ('k') | sdk/lib/io/http_utils.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698