[Bug]Session-level proxy silently ignored, leaks real IP
Summary
FetcherSession(proxy=...) is silently ignored. Requests go direct and leak the real client IP. Passing proxy= per request on .get()/.post() works fine, only the session-level config is broken. Same bug on AsyncFetcherClient.
Reproduce
from scrapling.fetchers import FetcherSession
with FetcherSession(proxy='http://10.255.255.1:9999', timeout=8, retries=1) as s:
r = s.get('http://httpbin.org/ip')
print(r.status, r.body)
Expected: timeout, since 10.255.255.1 is unroutable.
Actual: 200 b'{"origin": "<my real public IP>"}'.
Root cause
In scrapling/engines/static.py, _make_request always forwards proxy=proxy (often None) into _merge_request_args, so the session default never gets used:
"proxy": self._get_param(method_kwargs, "proxy", self._default_proxy),
The key is always present in method_kwargs, so the fallback branch is dead.
Fix
Only pass proxy into _merge_request_args when it's not None. Same thing needs fixing in the async path. Probably worth checking proxies and proxy_auth while you're in there.
Version
0.4.8, reproduces on main and dev.
Thanks @yetval for catching this one. A fix has been pushed to the dev branch.