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)
| 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 = '' |
no test coverage detected