MCPcopy Create free account
hub / github.com/RustPython/RustPython / _validate_host

Method _validate_host

Lib/http/client.py:1306–1312  ·  view source on GitHub ↗

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

(self, host)

Source from the content-addressed store, hash-verified

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."""
1308 # Prevent CVE-2019-18348.
1309 match = _contains_disallowed_url_pchar_re.search(host)
1310 if match:
1311 raise InvalidURL(f"URL can't contain control characters. {host!r} "
1312 f"(found at least {match.group()!r})")
1313
1314 def putheader(self, header, *values):
1315 """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