From 4e2ec455eb734e938fd5acda5409a363b2098278 Mon Sep 17 00:00:00 2001 From: hedy Date: Sun, 8 May 2022 18:20:45 +0800 Subject: [PATCH] Fix execution of /~user/index.gmi CGI Fixes #2 (gh). More like temp fix, but seems to work --- spsrv.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/spsrv.go b/spsrv.go index caf6ad3..141631e 100644 --- a/spsrv.go +++ b/spsrv.go @@ -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)