MCPcopy Index your code
hub / github.com/pyload/pyload / _parseHTTPContentType

Function _parseHTTPContentType

module/lib/feedparser.py:3420–3429  ·  view source on GitHub ↗

takes HTTP Content-Type header and returns (content type, charset) If no charset is specified, returns (content type, '') If no content type is specified, returns ('', '') Both return parameters are guaranteed to be lowercase strings

(content_type)

Source from the content-addressed store, hash-verified

3418 '''
3419
3420 def _parseHTTPContentType(content_type):
3421 '''takes HTTP Content-Type header and returns (content type, charset)
3422
3423 If no charset is specified, returns (content type, '')
3424 If no content type is specified, returns ('', '')
3425 Both return parameters are guaranteed to be lowercase strings
3426 '''
3427 content_type = content_type or ''
3428 content_type, params = cgi.parse_header(content_type)
3429 return content_type, params.get('charset', '').replace("'", '')
3430
3431 sniffed_xml_encoding = ''
3432 xml_encoding = ''

Callers 1

_getCharacterEncodingFunction · 0.85

Calls 2

replaceMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected