Skip to content

Commit 3e24961

Browse files
committed
docs: ddtrace_coms_minit_proxy_env patterns
1 parent 3957d67 commit 3e24961

1 file changed

Lines changed: 15 additions & 0 deletions

File tree

ext/coms.c

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,21 @@ static void ddtrace_store_env(char **target, const char *value) {
7171
}
7272
}
7373

74+
/* Snapshot the proxy-related environment variables curl itself consults.
75+
*
76+
* Generic pattern in libcurl (see url.c):
77+
* - For scheme-specific proxies, it looks up "<scheme>_proxy" in lowercase
78+
* first and, for most schemes, falls back to the uppercase variant
79+
* (e.g., "https_proxy" then "HTTPS_PROXY"). If no scheme-specific proxy
80+
* is found, it falls back to "all_proxy"/"ALL_PROXY".
81+
* - For the no-proxy list, it consults both "no_proxy" and "NO_PROXY".
82+
*
83+
* There is a special case in libcurl for HTTP: to avoid header-based
84+
* injection in CGI/server contexts, it does *not* automatically fall back
85+
* from "http_proxy" to "HTTP_PROXY". We still snapshot both here, but when
86+
* we later configure our agent handle we only ever use the cached value
87+
* explicitly, not libcurl's own HTTP_PROXY fallback.
88+
*/
7489
void ddtrace_coms_minit_proxy_env(void) {
7590
const char *v;
7691

0 commit comments

Comments
 (0)