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

Method _validate_host

Lib/http/client.py:1310–1316  ·  view source on GitHub ↗

Validate a host so it doesn't contain control characters.

(self, host)

Source from the content-addressed store, hash-verified

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."""
1312 # Prevent CVE-2019-18348.
1313 match = _contains_disallowed_url_pchar_re.search(host)
1314 if match:
1315 raise InvalidURL(f"URL can't contain control characters. {host!r} "
1316 f"(found at least {match.group()!r})")
1317
1318 def putheader(self, header, *values):
1319 """Send a request header line to the server.

Callers 1

__init__Method · 0.95

Calls 3

InvalidURLClass · 0.85
searchMethod · 0.45
groupMethod · 0.45

Tested by

no test coverage detected