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