Skip to content

Commit

Permalink
Pass a Uri to package:http APIs
Browse files Browse the repository at this point in the history
Prepare for dart-lang/http#375
  • Loading branch information
natebosch committed Dec 9, 2020
1 parent 8ea9612 commit 451c679
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
3 changes: 2 additions & 1 deletion lib/src/command/lish.dart
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,8 @@ class LishCommand extends PubCommand {

var location = postResponse.headers['location'];
if (location == null) throw PubHttpException(postResponse);
handleJsonSuccess(await client.get(location, headers: pubApiHeaders));
handleJsonSuccess(
await client.get(Uri.parse(location), headers: pubApiHeaders));
});
});
} on PubHttpException catch (error) {
Expand Down
4 changes: 2 additions & 2 deletions lib/src/command/login.dart
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@ class LoginCommand extends PubCommand {

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

0 comments on commit 451c679

Please sign in to comment.