Validate a url for putrequest.
(self, url)
| 1300 | f"(found at least {match.group()!r})") |
| 1301 | |
| 1302 | def _validate_path(self, url): |
| 1303 | """Validate a url for putrequest.""" |
| 1304 | # Prevent CVE-2019-9740. |
| 1305 | match = _contains_disallowed_url_pchar_re.search(url) |
| 1306 | if match: |
| 1307 | raise InvalidURL(f"URL can't contain control characters. {url!r} " |
| 1308 | f"(found at least {match.group()!r})") |
| 1309 | |
| 1310 | def _validate_host(self, host): |
| 1311 | """Validate a host so it doesn't contain control characters.""" |
no test coverage detected