mirror of
https://github.com/hansjone/oclaw.git
synced 2026-10-18 00:40:46 +08:00
fix(netx-tools): ignore system proxy for netx API calls
Set trust_env=False for netx tool HTTP clients so local netx endpoints are called directly instead of via host proxy settings. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
parent
04050747ae
commit
6307ade480
1 changed files with 6 additions and 3 deletions
|
|
@ -69,7 +69,8 @@ def _http_json(method: str, path: str, *, params: dict[str, Any] | None = None)
|
||||||
base = _netx_base_url()
|
base = _netx_base_url()
|
||||||
url = f"{base}{path}"
|
url = f"{base}{path}"
|
||||||
try:
|
try:
|
||||||
with httpx.Client(timeout=45.0) as client:
|
# Do not inherit system proxy settings for local netx calls.
|
||||||
|
with httpx.Client(timeout=45.0, trust_env=False) as client:
|
||||||
resp = client.request(method, url, params=params or None, headers=_netx_headers())
|
resp = client.request(method, url, params=params or None, headers=_netx_headers())
|
||||||
text = resp.text
|
text = resp.text
|
||||||
if not resp.is_success:
|
if not resp.is_success:
|
||||||
|
|
@ -492,7 +493,8 @@ def netx_sql_query_tool() -> ToolSpec:
|
||||||
base = _netx_base_url()
|
base = _netx_base_url()
|
||||||
url = f"{base}/v1/sql/query"
|
url = f"{base}/v1/sql/query"
|
||||||
try:
|
try:
|
||||||
with httpx.Client(timeout=60.0) as client:
|
# Do not inherit system proxy settings for local netx calls.
|
||||||
|
with httpx.Client(timeout=60.0, trust_env=False) as client:
|
||||||
resp = client.post(url, json={"sql": sql, "batch_id": batch_id, "limit": limit}, headers=_netx_headers())
|
resp = client.post(url, json={"sql": sql, "batch_id": batch_id, "limit": limit}, headers=_netx_headers())
|
||||||
text = resp.text
|
text = resp.text
|
||||||
if not resp.is_success:
|
if not resp.is_success:
|
||||||
|
|
@ -751,7 +753,8 @@ def netx_sql_query_ume_tool() -> ToolSpec:
|
||||||
base = _netx_base_url()
|
base = _netx_base_url()
|
||||||
url = f"{base}/v1/sql/ume_query"
|
url = f"{base}/v1/sql/ume_query"
|
||||||
try:
|
try:
|
||||||
with httpx.Client(timeout=60.0) as client:
|
# Do not inherit system proxy settings for local netx calls.
|
||||||
|
with httpx.Client(timeout=60.0, trust_env=False) as client:
|
||||||
resp = client.post(
|
resp = client.post(
|
||||||
url,
|
url,
|
||||||
json={"sql": sql, "limit": limit, "statement_timeout_ms": statement_timeout_ms},
|
json={"sql": sql, "limit": limit, "statement_timeout_ms": statement_timeout_ms},
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue