MCPcopy Create free account
hub / github.com/EasyIME/PIME / _normalize_header

Function _normalize_header

python/python3/tornado/httputil.py:67–73  ·  view source on GitHub ↗

Map a header name to Http-Header-Case. >>> _normalize_header("coNtent-TYPE") 'Content-Type'

(name: str)

Source from the content-addressed store, hash-verified

65
66@lru_cache(1000)
67def _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
76class HTTPHeaders(collections.abc.MutableMapping):

Callers 5

addMethod · 0.85
get_listMethod · 0.85
__setitem__Method · 0.85
__getitem__Method · 0.85
__delitem__Method · 0.85

Calls 3

joinMethod · 0.80
capitalizeMethod · 0.80
splitMethod · 0.80

Tested by

no test coverage detected