Skip to content

fix(rest): merge env vars when setting CURLOPT_NOPROXY - #16420

Merged
scotthart merged 2 commits into
googleapis:mainfrom
scotthart:rest_scope_mds_noproxy
Sep 8, 2026
Merged

scotthart merged 2 commits into
googleapis:mainfrom
scotthart:rest_scope_mds_noproxy

Conversation

@scotthart

Copy link
Copy Markdown
Member

fixes #16416

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request updates the libcurl transport implementation to respect the no_proxy and NO_PROXY environment variables when setting the CURLOPT_NOPROXY option. The review feedback highlights a potential performance and thread-safety issue with querying environment variables on every request, suggesting caching the result using a static variable. To maintain testability, the reviewer recommends splitting the implementation into cached and uncached helper functions, and updating the unit tests. Additionally, the reviewer advises against using std::string_view with temporary std::string objects to prevent potential lifetime issues.

Comment thread google/cloud/internal/curl_impl.cc Resolved
Comment thread google/cloud/internal/curl_impl.h Resolved
Comment thread google/cloud/internal/curl_impl_test.cc Resolved
@codecov

codecov Bot commented Sep 8, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 92.27%. Comparing base (4200a62) to head (0d7994d).

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #16420      +/-   ##
==========================================
+ Coverage   92.25%   92.27%   +0.02%     
==========================================
  Files        2246     2246              
  Lines      212528   212564      +36     
==========================================
+ Hits       196060   196151      +91     
+ Misses      16468    16413      -55     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@scotthart
scotthart merged commit c09b57d into googleapis:main Sep 8, 2026
63 of 67 checks passed

This branch was previously deployed

1 inactive deployment
false — 0d7994d1 Deployed Sep 8, 2026 by scotthart via Save PR ref #11562
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

CURLOPT_NOPROXY is set unconditionally, silently overriding the user's no_proxy environment variable

2 participants

Sponsor
SponsoredKunjungi sekarang
Promo