fix: Pass "Metadata-Flavor" header to metadata server when checking for GCE
This commit is contained in:
1 parent
464d2650d0
commit
efb9b7897a
2 files changed
+5
-1
No files matched your search
@@ -62,7 +62,8 @@ module Google
|
||||
# is available
|
||||
def on_gce? options = {}
|
||||
c = options[:connection] || Faraday.default_connection
|
||||
resp = c.get COMPUTE_CHECK_URI do |req|
|
||||
headers = { "Metadata-Flavor" => "Google" }
|
||||
resp = c.get COMPUTE_CHECK_URI, nil, headers do |req|
|
||||
# Comment from: oauth2client/client.py
|
||||
#
|
||||
# Note: the explicit `timeout` below is a workaround. The underlying
|
||||
|
||||
Reference in new issue
Block a user