Handler permission denied CGI error and serv as static

This commit is contained in:
Hedy Li 2021-08-13 12:09:26 +08:00
parent 01e0687594
commit 930dc6380f
Signed by: hedy
GPG Key ID: B51B5A8D1B176372
1 changed files with 4 additions and 0 deletions

View File

@ -81,6 +81,10 @@ func handleCGI(conf *Config, req *Request, cgiPath string) (ok bool) {
}
if err != nil {
log.Println("Error running CGI program " + path + ": " + err.Error())
if strings.Contains(err.Error(), "permission denied") {
ok = false
return
}
if err, ok := err.(*exec.ExitError); ok {
log.Println("↳ stderr output: " + string(err.Stderr))
}