6import httpx
7
8▶from langchain_core._security._exceptions import SSRFBlockedError
9from langchain_core._security._policy import (
10 DEFAULT_SSRF_POLICY,
· · ·
80 type=socket.SOCK_STREAM,
81 )
82▶ except socket.gaierror as exc:
83 msg = "DNS resolution failed"
84 raise SSRFBlockedError(msg) from exc
· · ·
84▶ raise SSRFBlockedError(msg) from exc
85
86 if not addrinfo:
· · ·
87 msg = "DNS resolution returned no results"
88▶ raise SSRFBlockedError(msg)
89
90 # 5. Validate ALL resolved IPs - any blocked means reject.
· · ·
162 type=socket.SOCK_STREAM,
163 )
164▶ except socket.gaierror as exc:
165 msg = "DNS resolution failed"
166 raise SSRFBlockedError(msg) from exc
+ 2 more matches in this file