Skip to content

Commit a377b5a

Browse files
authored
Pass a Uri to package:http APIs (#2794)
Prepare for dart-lang/http#375
1 parent 12d4907 commit a377b5a

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

lib/src/command/lish.dart

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,8 @@ class LishCommand extends PubCommand {
9696

9797
var location = postResponse.headers['location'];
9898
if (location == null) throw PubHttpException(postResponse);
99-
handleJsonSuccess(await client.get(location, headers: pubApiHeaders));
99+
handleJsonSuccess(
100+
await client.get(Uri.parse(location), headers: pubApiHeaders));
100101
});
101102
});
102103
} on PubHttpException catch (error) {

lib/src/command/login.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,8 @@ class LoginCommand extends PubCommand {
4040

4141
Future<_UserInfo> retrieveUserInfo() async {
4242
return await oauth2.withClient(cache, (client) async {
43-
final discovery = await httpClient
44-
.get('https://accounts.google.com/.well-known/openid-configuration');
43+
final discovery = await httpClient.get(Uri.https(
44+
'accounts.google.com', '/.well-known/openid-configuration'));
4545
final userInfoEndpoint = json.decode(discovery.body)['userinfo_endpoint'];
4646
final userInfoRequest = await client.get(userInfoEndpoint);
4747
if (userInfoRequest.statusCode != 200) return null;

0 commit comments

Comments
 (0)