| 408 | ) |
| 409 | |
| 410 | def putheader(self, header: str, *values: str) -> None: # type: ignore[override] |
| 411 | """""" |
| 412 | if not any(isinstance(v, str) and v == SKIP_HEADER for v in values): |
| 413 | super().putheader(header, *values) |
| 414 | elif to_str(header.lower()) not in SKIPPABLE_HEADERS: |
| 415 | skippable_headers = "', '".join( |
| 416 | [str.title(header) for header in sorted(SKIPPABLE_HEADERS)] |
| 417 | ) |
| 418 | raise ValueError( |
| 419 | f"urllib3.util.SKIP_HEADER only supports '{skippable_headers}'" |
| 420 | ) |
| 421 | |
| 422 | # `request` method's signature intentionally violates LSP. |
| 423 | # urllib3's API is different from `http.client.HTTPConnection` and the subclassing is only incidental. |