![]() |
Nilorea Library
C utilities for networking, threading, graphics
|
Media type of a file from its extension, for a static file server. More...
#include <stddef.h>Go to the source code of this file.
Functions | |
| int | n_http_mime_table_check (void) |
| check that the built-in table is sorted, as its lookup requires | |
| const char * | n_http_mime_type (const char *path, size_t len) |
| media type for a path or file name, from its extension | |
Media type of a file from its extension, for a static file server.
A fixed, sorted table (web pages, scripts, styles, images, fonts, media, WebAssembly, archives). Unlike netw_guess_http_content_type() it answers NULL for an unknown extension, so the server picks its own default (usually application/octet-stream served as an attachment) instead of sending an invalid type; the extension is taken from the last path segment only, the query string is ignored, and case does not matter.
Definition in file n_http_mime.h.