NetSurf
|
MIME type sniffer interface. More...
Go to the source code of this file.
Functions | |
nserror | mimesniff_compute_effective_type (const char *content_type_header, const uint8_t *data, size_t len, bool sniff_allowed, bool image_only, lwc_string **effective_type) |
Compute the effective MIME type for an object. More... | |
MIME type sniffer interface.
Definition in file mimesniff.h.
nserror mimesniff_compute_effective_type | ( | const char * | content_type_header, |
const uint8_t * | data, | ||
size_t | len, | ||
bool | sniff_allowed, | ||
bool | image_only, | ||
lwc_string ** | effective_type | ||
) |
Compute the effective MIME type for an object.
The implementation uses the sniffing algorithm described in http://mimesniff.spec.whatwg.org/
content_type_header | Source content type header |
data | First data chunk, or NULL |
len | Length of data, in bytes |
sniff_allowed | Whether MIME type sniffing is allowed |
image_only | Sniff image types only |
effective_type | Location to receive computed type |
Definition at line 563 of file mimesniff.c.
References content_factory_type_from_mime_type(), CONTENT_IMAGE, http_content_type_destroy(), http_parse_content_type(), http_content_type::media_type, mimesniff__compute_feed_or_html(), mimesniff__compute_image(), mimesniff__compute_text_or_binary(), mimesniff__compute_unknown(), NSERROR_NOT_FOUND, NSERROR_OK, S, and SLEN.
Referenced by hlcache_llcache_callback().