Skip to content

Commit 3bb14d8

Browse files
authored
fix: Bypass proxy for GCE metadata server requests (#15145)
* fix: Bypass proxy for GCE metadata server requests * fix: Bypass proxy for GCE metadata server requests * fix: Bypass proxy for GCE metadata server requests * fix: Bypass proxy for GCE metadata server requests * fix: Bypass proxy for GCE metadata server requests
1 parent b8e34d1 commit 3bb14d8

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

google/cloud/internal/curl_impl.cc

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -369,6 +369,10 @@ Status CurlImpl::MakeRequest(HttpMethod method, RestContext& context,
369369
status = handle_.SetOption(CURLOPT_PROXYPASSWORD, proxy_password_->c_str());
370370
if (!status.ok()) return OnTransferError(context, std::move(status));
371371
}
372+
373+
status = handle_.SetOption(CURLOPT_NOPROXY, "metadata.google.internal");
374+
if (!status.ok()) return OnTransferError(context, std::move(status));
375+
372376
if (interface_) {
373377
status = handle_.SetOption(CURLOPT_INTERFACE, interface_->c_str());
374378
if (!status.ok()) return OnTransferError(context, std::move(status));

0 commit comments

Comments
 (0)