(headers: Any)
| 309 | |
| 310 | |
| 311 | def _normalize_headers(headers: Any) -> Optional[Mapping[str, str]]: |
| 312 | if headers is None: |
| 313 | return None |
| 314 | if isinstance(headers, Mapping): |
| 315 | return headers |
| 316 | # httpx.Headers / list of pairs both iterate as items(). |
| 317 | try: |
| 318 | return dict(headers.items()) # type: ignore[no-any-return] |
| 319 | except AttributeError: |
| 320 | try: |
| 321 | return dict(headers) |
| 322 | except (TypeError, ValueError): |
| 323 | return None |
| 324 | |
| 325 | |
| 326 | def _parse_envelope(data: Any, body: Any) -> Any: |
no outgoing calls
no test coverage detected