(self, headers: Headers)
| 316 | raise ValueError(message) |
| 317 | |
| 318 | def get_part_charset(self, headers: Headers) -> str: |
| 319 | # Figure out input charset for current part |
| 320 | content_type = headers.get("content-type") |
| 321 | |
| 322 | if content_type: |
| 323 | parameters = parse_options_header(content_type)[1] |
| 324 | ct_charset = parameters.get("charset", "").lower() |
| 325 | |
| 326 | # A safe list of encodings. Modern clients should only send ASCII or UTF-8. |
| 327 | # This list will not be extended further. |
| 328 | if ct_charset in {"ascii", "us-ascii", "utf-8", "iso-8859-1"}: |
| 329 | return ct_charset |
| 330 | |
| 331 | return "utf-8" |
| 332 | |
| 333 | def start_file_streaming( |
| 334 | self, event: File, total_content_length: int | None |
no test coverage detected