summaryrefslogtreecommitdiff
path: root/contrib/cgi
diff options
context:
space:
mode:
authortjpcc <tjp@ctrl-c.club>2023-01-24 19:59:47 -0700
committertjpcc <tjp@ctrl-c.club>2023-01-24 19:59:47 -0700
commit997514292a8492d2291643e91081f3e790eefbaf (patch)
treeed870f158c6a6adfd91e490a64276bb704b56619 /contrib/cgi
parent23d705b93a89cb0aee582eda819a76257f42dffc (diff)
testing and linting and linter fixes
Diffstat (limited to 'contrib/cgi')
-rw-r--r--contrib/cgi/cgi.go4
1 files changed, 1 insertions, 3 deletions
diff --git a/contrib/cgi/cgi.go b/contrib/cgi/cgi.go
index ab10622..71743a0 100644
--- a/contrib/cgi/cgi.go
+++ b/contrib/cgi/cgi.go
@@ -116,9 +116,7 @@ func RunCGI(
}
scriptName := req.Path[:len(req.Path)-infoLen]
- if strings.HasSuffix(scriptName, "/") {
- scriptName = scriptName[:len(scriptName)-1]
- }
+ scriptName = strings.TrimSuffix(scriptName, "/")
cmd := exec.CommandContext(ctx, "./"+basename)
cmd.Env = prepareCGIEnv(ctx, req, scriptName, pathInfo)