summaryrefslogtreecommitdiff
path: root/finger.go
diff options
context:
space:
mode:
authortjpcc <tjp@ctrl-c.club>2023-10-10 14:49:08 -0600
committertjpcc <tjp@ctrl-c.club>2023-10-10 16:51:24 -0600
commit38a195c6e62dfebed3c0c642ec9e3fcc89516097 (patch)
tree699dd50488c8bf948ddc8d16757eeee619a884f5 /finger.go
parent7efb04b5d7b5c5363a8a0d95fce5513cd125ede9 (diff)
"cmd" modifier to override CGI executable
fixes #6
Diffstat (limited to 'finger.go')
-rw-r--r--finger.go7
1 files changed, 6 insertions, 1 deletions
diff --git a/finger.go b/finger.go
index 941e705..75d8160 100644
--- a/finger.go
+++ b/finger.go
@@ -61,7 +61,12 @@ func fingerHandler(route RouteDirective) sr.Handler {
}
if st.Mode()&5 == 5 && (route.Modifiers.Exec || route.Type == "cgi") {
- buf, code, err := cgi.RunCGI(ctx, request, fpath, "/", nil)
+ workdir := filepath.Dir(fpath)
+ if route.Modifiers.ExecCmd != "" {
+ fpath = route.Modifiers.ExecCmd
+ }
+
+ buf, code, err := cgi.RunCGI(ctx, request, fpath, "/", workdir, nil)
if err != nil {
return finger.Error("execution error")
}