MCPcopy Index your code
hub / github.com/RustPython/RustPython / _validate_path

Method _validate_path

Lib/http/client.py:1298–1304  ·  view source on GitHub ↗

Validate a url for putrequest.

(self, url)

Source from the content-addressed store, hash-verified

1296 f"(found at least {match.group()!r})")
1297
1298 def _validate_path(self, url):
1299 """Validate a url for putrequest."""
1300 # Prevent CVE-2019-9740.
1301 match = _contains_disallowed_url_pchar_re.search(url)
1302 if match:
1303 raise InvalidURL(f"URL can't contain control characters. {url!r} "
1304 f"(found at least {match.group()!r})")
1305
1306 def _validate_host(self, host):
1307 """Validate a host so it doesn't contain control characters."""

Callers 1

putrequestMethod · 0.95

Calls 3

InvalidURLClass · 0.85
searchMethod · 0.45
groupMethod · 0.45

Tested by

no test coverage detected