Fix execution of /~user/index.gmi CGI

Fixes #2 (gh).

More like temp fix, but seems to work
This commit is contained in:
hedy 2022-05-08 18:20:45 +08:00
parent 5a16845882
commit 4e2ec455eb
Signed by: hedy
GPG Key ID: B51B5A8D1B176372
1 changed files with 5 additions and 0 deletions

View File

@ -209,6 +209,11 @@ func handleConnection(netConn net.Conn, conf *Config) {
if req.user != "" && (!conf.UserCGIEnable || !conf.UserDirEnable) {
break
}
if req.user != "" && req.filePath == "" {
// TODO: Refactor - ATM `path` would contain the current CGI file wanted
// But for hitting /~user/, req.filePath is NOT index.gmi
req.filePath = "index.gmi"
}
log.Println("Attempting CGI:", req.filePath)
ok := handleCGI(conf, req, cgiPath)