mirror of
https://github.com/samsonjs/agate.git
synced 2026-03-25 09:05:50 +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 {
|
||||
// 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…
Reference in a new issue