Nilorea Library
C utilities for networking, threading, graphics
Loading...
Searching...
No Matches
n_http_mime.h File Reference

Media type of a file from its extension, for a static file server. More...

#include <stddef.h>
Include dependency graph for n_http_mime.h:
This graph shows which files directly or indirectly include this file:

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

Detailed Description

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.

Author
Castagnier Mickael
Version
1.0
Date
2026

Definition in file n_http_mime.h.