aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--handler.go2
-rw-r--r--input.go3
2 files changed, 4 insertions, 1 deletions
diff --git a/handler.go b/handler.go
index 0c81c2e..b913906 100644
--- a/handler.go
+++ b/handler.go
@@ -127,7 +127,7 @@ func (h Handler) Handle(r gemini.Request) gemini.Response {
return gemini.ErrorResponse(err)
}
- if isExecutable(path) {
+ if h.cfg.ExecuteFiles && isExecutable(path) {
return h.serveExecutable(r, path)
}
diff --git a/input.go b/input.go
index 6b3d0e8..12ccf78 100644
--- a/input.go
+++ b/input.go
@@ -42,6 +42,9 @@ type Config struct {
// default to 5
ExecTimeout int64 `toml:"exec_timeout"`
+ // default to false because the content might not be trusted
+ ExecuteFiles bool
+
TLSCert string `toml:"tls_certificate"`
TLSKey string `toml:"tls_key"`
}