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

Unified Diff: pkg/http/lib/src/multipart_request.dart

Issue 16019002: Merge the dart:uri library into dart:core and update the Uri class (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Add missing files 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 side-by-side diff with in-line comments
Download patch
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';
}

Powered by Google App Engine
This is Rietveld 408576698