Chromium Code Reviews| Index: pkg/http/lib/src/multipart_request.dart |
| diff --git a/pkg/http/lib/src/multipart_request.dart b/pkg/http/lib/src/multipart_request.dart |
| index ab66bbdd5db0bb81855d53446b42821bdc89374f..93e9ea7c87084c3117a23e81dcee874b46f6ec23 100644 |
| --- a/pkg/http/lib/src/multipart_request.dart |
| +++ b/pkg/http/lib/src/multipart_request.dart |
| @@ -7,7 +7,6 @@ library multipart_request; |
| import 'dart:async'; |
| import 'dart:io'; |
| import 'dart:math'; |
| -import 'dart:uri'; |
| import 'dart:utf'; |
| import 'base_request.dart'; |
| @@ -138,7 +137,7 @@ class MultipartRequest extends BaseRequest { |
| // http://tools.ietf.org/html/rfc2388 mandates some complex encodings for |
| // field names and file names, but in practice user agents seem to just |
| // URL-encode them so we do the same. |
| - var header = 'content-disposition: form-data; name="${encodeUri(name)}"'; |
| + var header = 'content-disposition: form-data; name="${Uri.encodeFull(name)}"'; |
|
nweiz
2013/05/24 18:59:10
long line
Søren Gjesse
2013/05/27 10:47:21
Done.
|
| if (!isPlainAscii(value)) { |
| header = '$header\r\ncontent-type: text/plain; charset=utf-8'; |
| } |
| @@ -149,10 +148,10 @@ class MultipartRequest extends BaseRequest { |
| /// contain only ASCII characters. |
| String _headerForFile(MultipartFile file) { |
| var header = 'content-type: ${file.contentType}\r\n' |
| - 'content-disposition: form-data; name="${encodeUri(file.field)}"'; |
| + 'content-disposition: form-data; name="${Uri.encodeFull(file.field)}"'; |
| if (file.filename != null) { |
| - header = '$header; filename="${encodeUri(file.filename)}"'; |
| + header = '$header; filename="${Uri.encodeFull(file.filename)}"'; |
| } |
| return '$header\r\n\r\n'; |
| } |