Skip to content

Commit 7fe2884

Browse files
authored
Fix: Bypass proxy for metadata based on libcurl version (#15155)
1 parent 3bb14d8 commit 7fe2884

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

google/cloud/internal/curl_impl.cc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -370,8 +370,10 @@ Status CurlImpl::MakeRequest(HttpMethod method, RestContext& context,
370370
if (!status.ok()) return OnTransferError(context, std::move(status));
371371
}
372372

373+
#if CURL_AT_LEAST_VERSION(7, 19, 4)
373374
status = handle_.SetOption(CURLOPT_NOPROXY, "metadata.google.internal");
374375
if (!status.ok()) return OnTransferError(context, std::move(status));
376+
#endif
375377

376378
if (interface_) {
377379
status = handle_.SetOption(CURLOPT_INTERFACE, interface_->c_str());

0 commit comments

Comments
 (0)