diff options
author | Yotam Nachum <me@yotam.net> | 2019-12-20 20:54:53 +0200 |
---|---|---|
committer | Yotam Nachum <me@yotam.net> | 2019-12-20 20:54:53 +0200 |
commit | 3a9ce465662599488ca98692a963bb680cfd872a (patch) | |
tree | c56a9372f2ef5038f3dbf1b01a854fa7f4d603d9 | |
parent | Execute requested file if it's executable (diff) | |
download | shavit-3a9ce465662599488ca98692a963bb680cfd872a.tar.gz shavit-3a9ce465662599488ca98692a963bb680cfd872a.zip |
Add an option to toggle execution feature
-rw-r--r-- | handler.go | 2 | ||||
-rw-r--r-- | input.go | 3 |
2 files changed, 4 insertions, 1 deletions
@@ -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) } @@ -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"` } |