Index: sdk/lib/_internal/pub/lib/src/utils.dart |
diff --git a/sdk/lib/_internal/pub/lib/src/utils.dart b/sdk/lib/_internal/pub/lib/src/utils.dart |
index 0311c9ded582b4bca6482da5bf0fc36472e0766e..bc90fdab4f9aae998b63422365fd5d2631850598 100644 |
--- a/sdk/lib/_internal/pub/lib/src/utils.dart |
+++ b/sdk/lib/_internal/pub/lib/src/utils.dart |
@@ -11,7 +11,6 @@ import 'dart:io'; |
import 'dart:isolate'; |
import 'dart:json' as json; |
import 'dart:mirrors'; |
-import 'dart:uri'; |
import 'package:pathos/path.dart' as path; |
@@ -321,8 +320,9 @@ Map<String, String> queryToMap(String queryList) { |
String mapToQuery(Map<String, String> map) { |
var pairs = <List<String>>[]; |
map.forEach((key, value) { |
- key = encodeUriComponent(key); |
- value = (value == null || value.isEmpty) ? null : encodeUriComponent(value); |
+ key = Uri.encodeQueryComponent(key); |
+ value = (value == null || value.isEmpty) |
+ ? null : Uri.encodeQueryComponent(value); |
pairs.add([key, value]); |
}); |
return pairs.map((pair) { |
@@ -339,13 +339,6 @@ bool urisEqual(Uri uri1, Uri uri2) => |
/// Return [uri] with redundant port information removed. |
Uri canonicalizeUri(Uri uri) { |
- if (uri == null) return null; |
- |
- var sansPort = new Uri.fromComponents( |
- scheme: uri.scheme, userInfo: uri.userInfo, domain: uri.domain, |
- path: uri.path, query: uri.query, fragment: uri.fragment); |
- if (uri.scheme == 'http' && uri.port == 80) return sansPort; |
- if (uri.scheme == 'https' && uri.port == 443) return sansPort; |
return uri; |
} |
@@ -354,10 +347,10 @@ Uri canonicalizeUri(Uri uri) { |
void mapAddAll(Map destination, Map source) => |
source.forEach((key, value) => destination[key] = value); |
-/// Decodes a URL-encoded string. Unlike [decodeUriComponent], this includes |
+/// Decodes a URL-encoded string. Unlike [Uri.decodeComponent], this includes |
/// replacing `+` with ` `. |
String urlDecode(String encoded) => |
- decodeUriComponent(encoded.replaceAll("+", " ")); |
+ Uri.decodeComponent(encoded.replaceAll("+", " ")); |
/// Takes a simple data structure (composed of [Map]s, [Iterable]s, scalar |
/// objects, and [Future]s) and recursively resolves all the [Future]s contained |