Validate a method name for putrequest.
(self, method)
| 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.""" |
no test coverage detected