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

Method _validate_method

Lib/http/client.py:1293–1300  ·  view source on GitHub ↗

Validate a method name for putrequest.

(self, method)

Source from the content-addressed store, hash-verified

1291 return request.encode('ascii')
1292
1293 def _validate_method(self, method):
1294 """Validate a method name for putrequest."""
1295 # prevent http header injection
1296 match = _contains_disallowed_method_pchar_re.search(method)
1297 if match:
1298 raise ValueError(
1299 f"method can't contain control characters. {method!r} "
1300 f"(found at least {match.group()!r})")
1301
1302 def _validate_path(self, url):
1303 """Validate a url for putrequest."""

Callers 1

putrequestMethod · 0.95

Calls 2

searchMethod · 0.45
groupMethod · 0.45

Tested by

no test coverage detected