Map a header name to Http-Header-Case. >>> _normalize_header("coNtent-TYPE") 'Content-Type'
(name: str)
| 65 | |
| 66 | @lru_cache(1000) |
| 67 | def _normalize_header(name: str) -> str: |
| 68 | """Map a header name to Http-Header-Case. |
| 69 | |
| 70 | >>> _normalize_header("coNtent-TYPE") |
| 71 | 'Content-Type' |
| 72 | """ |
| 73 | return "-".join([w.capitalize() for w in name.split("-")]) |
| 74 | |
| 75 | |
| 76 | class HTTPHeaders(collections.abc.MutableMapping): |
no test coverage detected