| 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 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 Loading... |
| 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 Loading... |
| 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 |
| OLD | NEW |