1
0
mirror of synced 2025-07-29 11:01:13 +03:00

Extend built-in extension MIME mapping (#799)

* Update README.md

* Update httplib.h

* Update httplib.h

* Update httplib.h

* Update httplib.h

* Remove duplicate cases

Someone left a bunch of duplicate cases, idiot, couldn't have been me.

* Reformat

Modify spacing and whatnot

* Update README.md
This commit is contained in:
Anonymous
2020-12-18 06:32:19 -08:00
committed by GitHub
parent 0e3925db3f
commit 0cff3245df
2 changed files with 96 additions and 39 deletions

View File

@ -120,22 +120,48 @@ svr.set_file_extension_and_mimetype_mapping("hh", "text/x-h");
The followings are built-in mappings:
| Extension | MIME Type |
| :-------- | :--------------------- |
| txt | text/plain |
| html, htm | text/html |
| css | text/css |
| jpeg, jpg | image/jpg |
| png | image/png |
| gif | image/gif |
| svg | image/svg+xml |
| ico | image/x-icon |
| json | application/json |
| pdf | application/pdf |
| js | application/javascript |
| wasm | application/wasm |
| xml | application/xml |
| xhtml | application/xhtml+xml |
| Extension | MIME Type |
| :--------- | :-------------------------- |
| css | text/css |
| csv | text/csv |
| txt | text/plain |
| vtt | text/vtt |
| html, htm | text/html |
| apng | image/apng |
| avif | image/avif |
| bmp | image/bmp |
| gif | image/gif |
| png | image/png |
| svg | image/svg+xml |
| webp | image/webp |
| ico | image/x-icon |
| tif | image/tiff |
| tiff | image/tiff |
| jpeg, jpg | image/jpeg |
| mp4 | video/mp4 |
| mpeg | video/mpeg |
| webm | video/webm |
| mp3 | audio/mp3 |
| mpga | audio/mpeg |
| weba | audio/webm |
| wav | audio/wave |
| otf | font/otf |
| ttf | font/ttf |
| woff | font/woff |
| woff2 | font/woff2 |
| 7z | application/x-7z-compressed |
| atom | application/atom+xml |
| pdf | application/pdf |
| mjs, js | application/javascript |
| json | application/json |
| rss | application/rss+xml |
| tar | application/x-tar |
| xhtml, xht | application/xhtml+xml |
| xslt | application/xslt+xml |
| xml | application/xml |
| gz | application/gzip |
| zip | application/zip |
| wasm | application/wasm |
NOTE: These the static file server methods are not thread safe.