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