mirror of
https://github.com/YGGverse/agate.git
synced 2026-04-08 20:45:29 +00:00
correctly redirect directories
cf. <https://lists.orbitalfox.eu/archives/gemini/2021/004827.html>
This commit is contained in:
parent
681ba770a1
commit
972ecf8c13
1 changed files with 3 additions and 1 deletions
|
|
@ -204,7 +204,9 @@ async fn send_response(url: Url, stream: &mut TlsStream<TcpStream>) -> Result {
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
// if client is not redirected, links may not work as expected without trailing slash
|
// if client is not redirected, links may not work as expected without trailing slash
|
||||||
return send_header(stream, 31, &[url.as_str(), "/"]).await;
|
let mut url = url;
|
||||||
|
url.set_path(&format!("{}/", url.path()));
|
||||||
|
return send_header(stream, 31, &[url.as_str()]).await;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue