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

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: Final 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « pkg/http/lib/src/base_request.dart ('k') | pkg/http/lib/src/request.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..6d8f03bc967753a48a840d7e387800c69687e9b1 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,8 @@ 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)}"';
if (!isPlainAscii(value)) {
header = '$header\r\ncontent-type: text/plain; charset=utf-8';
}
@@ -149,10 +149,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';
}
« no previous file with comments | « pkg/http/lib/src/base_request.dart ('k') | pkg/http/lib/src/request.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698