mygit

[UNMAINTAINED] A cgit/webgit alternative, written in Rust
Log | Files | Refs | README | LICENSE

commit b9a32cbdd89e835b506ac38483b5997da4456ab6
parent a4755529f1c71ade4f32bbf9e65d8d7570c6cd4f
Author: Johann150 <johann@qwertqwefsday.eu>
Date:   Fri,  2 Apr 2021 13:20:31 +0200

handle paths with slashes

This seems to be the simplest way to handle this. Middleware does not
seem to be able to change the request's path and there is an open issue
on tide's repository: https://github.com/http-rs/tide/issues/205

Diffstat:
Msrc/main.rs | 3+++
1 file changed, 3 insertions(+), 0 deletions(-)

diff --git a/src/main.rs b/src/main.rs @@ -688,9 +688,12 @@ async fn main() -> Result<(), std::io::Error> { app.at("/:repo_name/commit/:commit").get(repo_commit); app.at("/:repo_name/refs").get(repo_refs); app.at("/:repo_name/log").get(repo_log); + app.at("/:repo_name/log/").get(repo_log); app.at("/:repo_name/log/:ref").get(repo_log); // ref is optional app.at("/:repo_name/tree").get(repo_tree); + app.at("/:repo_name/tree/").get(repo_tree); app.at("/:repo_name/tree/:ref").get(repo_tree); // ref is optional + app.at("/:repo_name/tree/:ref/").get(repo_tree); // ref is optional app.at("/:repo_name/tree/:ref/item/*object_name") .get(repo_file);