Added Metadata-Flavor header in request for IsRunningOnComputeEngine#1410
Merged
chrisdunelm merged 1 commit intogoogleapis:masterfrom Jun 11, 2019
cilliemalan:master
Merged
Added Metadata-Flavor header in request for IsRunningOnComputeEngine#1410chrisdunelm merged 1 commit intogoogleapis:masterfrom cilliemalan:master
chrisdunelm merged 1 commit intogoogleapis:masterfrom
cilliemalan:master
Conversation
jskeet
reviewed
Jun 10, 2019
| try | ||
| { | ||
| var httpRequest = new HttpRequestMessage(HttpMethod.Get, MetadataServerUrl); | ||
| var httpRequest = new HttpRequestMessage(HttpMethod.Get, MetadataServerUrl); |
Collaborator
There was a problem hiding this comment.
I can't tell in GitHub what's changed on this line of code. Was there some whitespace that I'm failing to see?
Contributor
Author
There was a problem hiding this comment.
Turns out I use windows line endings 😄
jskeet
approved these changes
Jun 11, 2019
Collaborator
jskeet
left a comment
There was a problem hiding this comment.
LGTM, but will wait for @chrisdunelm to weigh in too.
chrisdunelm
approved these changes
Jun 11, 2019
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #1409
The method IsRunningOnComputeEngineNoCache checks that the metadata server returns the header Metadata-Flavor: Google. However, that endpoint will return an error if that same header is not also supplied in the request.
This means that one cannot use the default compute service account or Workload Identity