Extract and parse query parameters from the request.
(query_string: bytes)
| 46 | |
| 47 | |
| 48 | def get_query_params(query_string: bytes) -> dict[str, str]: |
| 49 | """Extract and parse query parameters from the request.""" |
| 50 | args = parse_qs(query_string.decode(), keep_blank_values=True) |
| 51 | result_args = {} |
| 52 | |
| 53 | for key, values in args.items(): |
| 54 | if values: |
| 55 | result_args[key] = values[0] |
| 56 | |
| 57 | return result_args |
| 58 | |
| 59 | |
| 60 | def get_cookies_from_headers(headers: dict[str, Any]) -> dict[str, str]: |
no test coverage detected