Fixed bugs in cgi-everywhere

This commit is contained in:
int 80h
2020-05-23 17:55:26 -04:00
parent 16f9358128
commit 5c00fb24fd
2 changed files with 7 additions and 5 deletions

View File

@@ -1,6 +1,6 @@
[package] [package]
name = "gemserv" name = "gemserv"
version = "0.3.1" version = "0.3.2"
authors = ["int 80h <int@80h.dev>"] authors = ["int 80h <int@80h.dev>"]
edition = "2018" edition = "2018"

View File

@@ -244,10 +244,6 @@ async fn handle_connection(
con.send_status(Status::CGIError, None).await?; con.send_status(Status::CGIError, None).await?;
return Ok(()); return Ok(());
} }
} else {
logger::logger(con.peer_addr, Status::CGIError, &request);
con.send_status(Status::CGIError, None).await?;
return Ok(());
} }
}, },
None => { None => {
@@ -259,6 +255,12 @@ async fn handle_connection(
} }
} }
if perm.mode() & 0o0111 == 0o0111 {
logger::logger(con.peer_addr, Status::NotFound, &request);
con.send_status(Status::NotFound, None).await?;
return Ok(());
}
if perm.mode() & 0o0444 != 0o0444 { if perm.mode() & 0o0444 != 0o0444 {
logger::logger(con.peer_addr, Status::NotFound, &request); logger::logger(con.peer_addr, Status::NotFound, &request);
con.send_status(Status::NotFound, None).await?; con.send_status(Status::NotFound, None).await?;