Extract request headers and return them as a dictionary.
(scope: dict[str, Any])
| 38 | |
| 39 | |
| 40 | def get_headers_dict(scope: dict[str, Any]) -> dict[str, str]: |
| 41 | """Extract request headers and return them as a dictionary.""" |
| 42 | headers = {} |
| 43 | for name, value in scope.get('headers', []): |
| 44 | headers[name.decode()] = value.decode() |
| 45 | return headers |
| 46 | |
| 47 | |
| 48 | def get_query_params(query_string: bytes) -> dict[str, str]: |
no outgoing calls
no test coverage detected