Add error logging when CGI failed

This commit is contained in:
hedy 2022-03-30 15:37:38 +08:00
parent 1cf4ef3952
commit 60374d9e70
Signed by: hedy
GPG Key ID: B51B5A8D1B176372
1 changed files with 2 additions and 0 deletions

View File

@ -26,10 +26,12 @@ func handleCGI(conf *Config, req *Request, cgiPath string) (ok bool) {
info, err := os.Stat(scriptPath)
if err != nil {
log.Println(err.Error())
ok = false
return
}
if !(info.Mode().Perm()&0555 == 0555) {
log.Println("File not executable")
ok = false
return
}