MCPcopy
hub / github.com/tornadoweb/tornado / _normalize_header

Function _normalize_header

tornado/httputil.py:136–142  ·  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

134
135@lru_cache(1000)
136def _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
145class HTTPHeaders(StrMutableMapping):

Callers 6

addMethod · 0.85
get_listMethod · 0.85
__setitem__Method · 0.85
__contains__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