Skip to content
Permalink
Browse files
fix: specify Metadata-Flavor for metadata requests (#1397)
  • Loading branch information
Erik authored and chingor13 committed Oct 21, 2019
1 parent 1ffdba6 commit d3dcfe9c049f72207b30e75f073b4b8ccc14c46d
Showing with 1 addition and 0 deletions.
  1. +1 −0 google-api-client/src/main/java/com/google/api/client/googleapis/auth/oauth2/OAuth2Utils.java
@@ -83,6 +83,7 @@ static boolean runningOnComputeEngine(HttpTransport transport,
try {
HttpRequest request = transport.createRequestFactory().buildGetRequest(tokenUrl);
request.setConnectTimeout(COMPUTE_PING_CONNECTION_TIMEOUT_MS);
request.getHeaders().set("Metadata-Flavor", "Google");
HttpResponse response = request.execute();
try {
HttpHeaders headers = response.getHeaders();

0 comments on commit d3dcfe9

Please sign in to comment.