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

Method _validate_method

Lib/http/client.py:1289–1296  ·  view source on GitHub ↗

Validate a method name for putrequest.

(self, method)

Source from the content-addressed store, hash-verified

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

Callers 1

putrequestMethod · 0.95

Calls 2

searchMethod · 0.45
groupMethod · 0.45

Tested by

no test coverage detected