mirror of
https://github.com/samsonjs/agate.git
synced 2026-03-25 09:05:50 +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>> {
|
||||
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() {
|
||||
path.push("index.gemini");
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue