MCPcopy Index your code
hub / github.com/python/cpython / _validate_path

Method _validate_path

Lib/http/client.py:1302–1308  ·  view source on GitHub ↗

Validate a url for putrequest.

(self, url)

Source from the content-addressed store, hash-verified

1300 f"(found at least {match.group()!r})")
1301
1302 def _validate_path(self, url):
1303 """Validate a url for putrequest."""
1304 # Prevent CVE-2019-9740.
1305 match = _contains_disallowed_url_pchar_re.search(url)
1306 if match:
1307 raise InvalidURL(f"URL can't contain control characters. {url!r} "
1308 f"(found at least {match.group()!r})")
1309
1310 def _validate_host(self, host):
1311 """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