This commit is contained in:
Hedy Li 2021-08-02 21:17:13 +08:00
parent 7eff471da0
commit 4e96db6122
Signed by: hedy
GPG Key ID: B51B5A8D1B176372
1 changed files with 9 additions and 8 deletions

View File

@ -169,15 +169,16 @@ func handleConnection(netConn net.Conn, conf *Config) {
// Check for CGI
for _, cgiPath := range conf.CGIPaths {
if strings.HasPrefix(req.filePath, cgiPath) {
if req.user != "" && conf.UserCGIEnable {
log.Println("Attempting CGI:", req.filePath)
ok := handleCGI(conf, req, cgiPath)
if ok {
return
}
break // CGI failed. just handle the request as if it's a static file.
if req.user != "" && !conf.UserCGIEnable {
break
}
log.Println("Attempting CGI:", req.filePath)
ok := handleCGI(conf, req, cgiPath)
if ok {
return
}
break // CGI failed. just handle the request as if it's a static file.
}
}