diff options
| author | tjpcc <tjp@ctrl-c.club> | 2023-01-23 22:15:16 -0700 |
|---|---|---|
| committer | tjpcc <tjp@ctrl-c.club> | 2023-01-23 22:15:16 -0700 |
| commit | 0480e066a3f1ae97dbab8fcb6303589eb0fa724c (patch) | |
| tree | 1aa347eb3691a29987475fcf6049343aa227a365 /contrib/cgi | |
| parent | df57a12539030297b3254bc81f5696691cbc9c6f (diff) | |
logging library up to top level
Diffstat (limited to 'contrib/cgi')
| -rw-r--r-- | contrib/cgi/cgi.go | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/contrib/cgi/cgi.go b/contrib/cgi/cgi.go index 6a420b3..ab10622 100644 --- a/contrib/cgi/cgi.go +++ b/contrib/cgi/cgi.go @@ -110,7 +110,12 @@ func RunCGI( } basename := pathSegments[len(pathSegments)-1] - scriptName := req.Path[:len(req.Path)-len(pathInfo)] + infoLen := len(pathInfo) + if pathInfo == "/" { + infoLen -= 1 + } + + scriptName := req.Path[:len(req.Path)-infoLen] if strings.HasSuffix(scriptName, "/") { scriptName = scriptName[:len(scriptName)-1] } |
