(
headers: list[tuple[bytes, bytes]], is_client: bool
)
| 338 | |
| 339 | |
| 340 | def normalize_h1_headers( |
| 341 | headers: list[tuple[bytes, bytes]], is_client: bool |
| 342 | ) -> list[tuple[bytes, bytes]]: |
| 343 | # HTTP/1 servers commonly send capitalized headers (Content-Length vs content-length), |
| 344 | # which isn't valid HTTP/2. As such we normalize. |
| 345 | # Make sure that this is not just an iterator but an iterable, |
| 346 | # otherwise hyper-h2 will silently drop headers. |
| 347 | return list( |
| 348 | h2.utilities.normalize_outbound_headers( |
| 349 | headers, |
| 350 | h2.utilities.HeaderValidationFlags(is_client, False, not is_client, False), |
| 351 | ) |
| 352 | ) |
| 353 | |
| 354 | |
| 355 | def normalize_h2_headers(headers: list[tuple[bytes, bytes]]) -> CommandGenerator[None]: |
no outgoing calls
no test coverage detected
searching dependent graphs…