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 library utils; | 5 library utils; |
6 | 6 |
7 import 'dart:async'; | 7 import 'dart:async'; |
8 import 'dart:isolate'; | 8 import 'dart:isolate'; |
9 import 'dart:crypto'; | 9 |
| 10 import "package:crypto/crypto.dart"; |
10 | 11 |
11 /// Adds additional query parameters to [url], overwriting the original | 12 /// Adds additional query parameters to [url], overwriting the original |
12 /// parameters if a name conflict occurs. | 13 /// parameters if a name conflict occurs. |
13 Uri addQueryParameters(Uri url, Map<String, String> parameters) { | 14 Uri addQueryParameters(Uri url, Map<String, String> parameters) { |
14 var queryMap = queryToMap(url.query); | 15 var queryMap = queryToMap(url.query); |
15 mapAddAll(queryMap, parameters); | 16 mapAddAll(queryMap, parameters); |
16 return url.resolve("?${mapToQuery(queryMap)}"); | 17 return url.resolve("?${mapToQuery(queryMap)}"); |
17 } | 18 } |
18 | 19 |
19 /// Convert a URL query string (or `application/x-www-form-urlencoded` body) | 20 /// Convert a URL query string (or `application/x-www-form-urlencoded` body) |
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
109 throw new FormatException('Invalid WWW-Authenticate header: "$header"'); | 110 throw new FormatException('Invalid WWW-Authenticate header: "$header"'); |
110 } | 111 } |
111 | 112 |
112 return new AuthenticateHeader(scheme, parameters); | 113 return new AuthenticateHeader(scheme, parameters); |
113 } | 114 } |
114 } | 115 } |
115 | 116 |
116 /// Returns a [Future] that asynchronously completes to `null`. | 117 /// Returns a [Future] that asynchronously completes to `null`. |
117 Future get async => new Future.delayed(const Duration(milliseconds: 0), | 118 Future get async => new Future.delayed(const Duration(milliseconds: 0), |
118 () => null); | 119 () => null); |
OLD | NEW |