diff --git a/README.md b/README.md index efe88c4..582f140 100644 --- a/README.md +++ b/README.md @@ -29,7 +29,7 @@ openssl req -x509 -newkey rsa:4096 -keyout key.rsa -out cert.pem \ agate 0.0.0.0: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. +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.gmi` inside that directory. [Gemini]: https://gemini.circumlunar.space/ [Rust]: https://www.rust-lang.org/ diff --git a/src/main.rs b/src/main.rs index 4bc9c96..324ab84 100644 --- a/src/main.rs +++ b/src/main.rs @@ -125,14 +125,14 @@ async fn send_response(url: &Url, mut stream: W) -> Result { } if path.is_dir().await { if url.as_str().ends_with('/') { - path.push("index.gemini"); + path.push("index.gmi"); } else { return redirect_slash(url, stream).await; } } match async_std::fs::read(&path).await { Ok(body) => { - if path.extension() == Some(OsStr::new("gemini")) { + if path.extension() == Some(OsStr::new("gmi")) { stream.write_all(b"20 text/gemini\r\n").await?; } else { let mime = tree_magic::from_u8(&body);