~int80h/gemserv

e5c44c2c536bfd08d885907c6f23a33f44383862 — int 80h 6 months ago 077357e
Fixed redirect and scgi path when its the root url
1 files changed, 8 insertions(+), 2 deletions(-)

M src/main.rs
M src/main.rs => src/main.rs +8 -2
@@ 238,7 238,10 @@ async fn handle_connection(

    match &srv.server.redirect {
        Some(re) => {
            let u = url.path().trim_end_matches("/");
            let u = match url.path() {
                "/" => "/",
                _ => url.path().trim_end_matches("/"),
            };
            match re.get(u) {
                Some(r) => {
                    logger::logger(con.peer_addr, Status::RedirectTemporary, &request);


@@ 288,7 291,10 @@ async fn handle_connection(
    #[cfg(feature = "scgi")]
    match &srv.server.scgi {
        Some(sc) => {
        let u = url.path().trim_end_matches("/");
            let u = match url.path() {
                "/" => "/",
                _ => url.path().trim_end_matches("/"),
            };
        match sc.get(u) {
            Some(r) => {
                cgi::scgi(r.to_string(), url, con, srv).await?;