Map a header name to Http-Header-Case. >>> _normalize_header("coNtent-TYPE") 'Content-Type'
(name: str)
| 134 | |
| 135 | @lru_cache(1000) |
| 136 | def _normalize_header(name: str) -> str: |
| 137 | """Map a header name to Http-Header-Case. |
| 138 | |
| 139 | >>> _normalize_header("coNtent-TYPE") |
| 140 | 'Content-Type' |
| 141 | """ |
| 142 | return "-".join([w.capitalize() for w in name.split("-")]) |
| 143 | |
| 144 | |
| 145 | class HTTPHeaders(StrMutableMapping): |
no test coverage detected