wired
libc-free QUIC/HTTP3 SDK in C for x86_64-linux
Loading...
Searching...
No Matches
mimetype.h File Reference

Infer an HTTP Content-Type from a static file's path, by its extension (the substring after the last '. More...

Go to the source code of this file.

Functions

const char * wired_mimetype_for_path (const char *path)
 Return the Content-Type for path's extension, or "application/octet- stream" when the extension is absent or unrecognized.

Detailed Description

Infer an HTTP Content-Type from a static file's path, by its extension (the substring after the last '.

' in the final path segment).

Function Documentation

◆ wired_mimetype_for_path()

const char * wired_mimetype_for_path ( const char * path)

Return the Content-Type for path's extension, or "application/octet- stream" when the extension is absent or unrecognized.

The returned string is a static constant; the caller must not free it.

Parameters
pathNUL-terminated file path (request path or resolved file path)
Returns
NUL-terminated Content-Type string