Skip to content

Commit 744ca64

Browse files
committed
Updated metadata service header
1 parent b661c62 commit 744ca64

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

google-cloud-core/src/main/java/com/google/cloud/ServiceOptions.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -408,7 +408,7 @@ protected static String googleCloudProjectId() {
408408
try {
409409
URL url = new URL("http://metadata/computeMetadata/v1/project/project-id");
410410
HttpURLConnection connection = (HttpURLConnection) url.openConnection();
411-
connection.setRequestProperty("X-Google-Metadata-Request", "True");
411+
connection.setRequestProperty("Metadata-Flavor", "Google");
412412
InputStream input = connection.getInputStream();
413413
if (connection.getResponseCode() == 200) {
414414
try (BufferedReader reader = new BufferedReader(new InputStreamReader(input, UTF_8))) {

0 commit comments

Comments
 (0)