Auto-detect MIME types

This commit is contained in:
Matt Brubeck 2020-05-21 15:28:07 -07:00
parent db5665b783
commit ce570fc8c4
4 changed files with 125 additions and 12 deletions

View file

@ -29,7 +29,7 @@ openssl req -x509 -newkey rsa:4096 -keyout key.rsa -out cert.pem \
agate localhost:1965 path/to/content/ cert.pem key.rsa
```
When a client requests the URL `gemini://example.com/foo/bar`, Agate will respond with the file at `path/to/content/foo/bar`. If there is a directory at that path, Agate will look for a file named `index.gemini` inside that directory. Currently, Agate sends all responses with the `text/gemini` MIME type. (Support for other MIME types may be added in the future.)
When a client requests the URL `gemini://example.com/foo/bar`, Agate will respond with the file at `path/to/content/foo/bar`. If there is a directory at that path, Agate will look for a file named `index.gemini` inside that directory.
[Gemini]: https://gemini.circumlunar.space/
[Rust]: https://www.rust-lang.org/