Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deprecate use of X-Google-Metadata-Request in favor new Metadata-Flavor header #70

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions lib/src/console/oauth2_console_client/oauth2.dart
Original file line number Diff line number Diff line change
Expand Up @@ -314,7 +314,7 @@ class SimpleOAuth2Console implements OAuth2Console {
*/
class ComputeOAuth2Console implements OAuth2Console {
Uri _tokenEndpoint =
Uri.parse('http://metadata/computeMetadata/v1beta1/instance/service-accounts/default/token');
Uri.parse('http://metadata/computeMetadata/v1/instance/service-accounts/default/token');
Uri get tokenEndpoint => _tokenEndpoint;

Credentials _credentials;
Expand Down Expand Up @@ -446,7 +446,7 @@ class ComputeEngineClient extends http.BaseClient implements Client {
http.Client _httpClient;

Uri _tokenEndpoint =
Uri.parse('http://metadata/computeMetadata/v1beta1/instance/service-accounts/default/token');
Uri.parse('http://metadata/computeMetadata/v1/instance/service-accounts/default/token');

ComputeEngineClient(this.projectId,
{http.Client httpClient})
Expand All @@ -470,7 +470,7 @@ class ComputeEngineClient extends http.BaseClient implements Client {
Future<Client> refreshCredentials([List<String> newScopes]) {
return async.then((_) {
return _httpClient.get(_tokenEndpoint,
headers: {'X-Google-Metadata-Request': 'True'});
headers: {'Metadata-Flavor': 'Google'});
}).then((http.Response response) {
if (response.statusCode == 200) {
// Successful request
Expand Down