mirror of
https://github.com/YGGverse/agate.git
synced 2026-04-08 20:45:29 +00:00
Don't panic on cannot-be-a-base URLs
This commit is contained in:
parent
0872e3d1fe
commit
85ea736eb2
1 changed files with 1 additions and 1 deletions
|
|
@ -106,7 +106,7 @@ async fn parse_request(stream: &mut TlsStream<TcpStream>) -> Result<Url> {
|
||||||
|
|
||||||
fn get(url: &Url) -> Result<Vec<u8>> {
|
fn get(url: &Url) -> Result<Vec<u8>> {
|
||||||
let mut path = PathBuf::from(&ARGS.content_dir);
|
let mut path = PathBuf::from(&ARGS.content_dir);
|
||||||
path.extend(url.path_segments().unwrap());
|
path.extend(url.path_segments().ok_or("invalid url")?);
|
||||||
if path.is_dir() {
|
if path.is_dir() {
|
||||||
path.push("index.gemini");
|
path.push("index.gemini");
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue