diff options
| author | tjpcc <tjp@ctrl-c.club> | 2023-10-10 14:49:08 -0600 |
|---|---|---|
| committer | tjpcc <tjp@ctrl-c.club> | 2023-10-10 16:51:24 -0600 |
| commit | 38a195c6e62dfebed3c0c642ec9e3fcc89516097 (patch) | |
| tree | 699dd50488c8bf948ddc8d16757eeee619a884f5 /finger.go | |
| parent | 7efb04b5d7b5c5363a8a0d95fce5513cd125ede9 (diff) | |
"cmd" modifier to override CGI executable
fixes #6
Diffstat (limited to 'finger.go')
| -rw-r--r-- | finger.go | 7 |
1 files changed, 6 insertions, 1 deletions
@@ -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") } |
