aboutsummaryrefslogtreecommitdiff
path: root/mime.c
AgeCommit message (Collapse)Author
2022-07-04copyright yearsOmar Polo
2022-04-08hardcode the mapping text/gemini -> .gmi/.geminiOmar Polo
It's still possible to override this automatic mapping by just adding an entry like application/octet-stream gemini gmi in the `types' block.
2022-04-08sort the MIME mappings and do a binary search to matchOmar Polo
2022-04-08allow add_mime to failOmar Polo
add_mime nows allocate dinamically copies of the passed strings, so that we can actually free what we parse from the config file. This matters a lot especially with lengthy `types' block: strings that reach the internal mapping are never free'd, so every manual addition is leaked.
2022-03-19const-ify some tablesOmar Polo
matches found with % grep -R '=[ ]*{' . | fgrep -v const
2021-04-22missing comma ,Omar Polo
2021-04-21use `text/x-patch' for .patch and .diff filesOmar Polo
2021-02-12fix various compilation errorsOmar Polo
Include gmid.h as first header in every file, as it then includes config.h (that defines _GNU_SOURCE for instance). Fix also a warning about unsigned vs signed const char pointers in openssl.
2021-01-24added support for location blocksOmar Polo
2021-01-21use recallocarrayOmar Polo
it also does an overflow check on multiplication, other than being more readable.
2021-01-21rename mimes to mime ; pass config esplicitly to mime* functionsOmar Polo
2021-01-19moving "default type" from global options to server optionsOmar Polo
2021-01-18move mimes into the struct configOmar Polo
2021-01-18add "mime" and "default type" option for the configurationOmar Polo
2021-01-18improve mime handlingOmar Polo
we still have an hardcoded list, but this implements the API needed to modify the mappings.