summaryrefslogtreecommitdiff
path: root/contrib/cgi
diff options
context:
space:
mode:
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)