diff options
author | Luke Granger-Brown <git@lukegb.com> | 2020-06-18 03:11:24 +0100 |
---|---|---|
committer | Michael Muré <batolettre@gmail.com> | 2020-06-27 22:56:11 +0200 |
commit | 43c78da02ecd2d49a45632e5b3270cd0c9da474f (patch) | |
tree | 31d02fcce2a7d9181e55d1a63f45135fd6248357 /commands/webui.go | |
parent | 4a28f25347addf05708cdff37ecace4139f01779 (diff) | |
download | git-bug-43c78da02ecd2d49a45632e5b3270cd0c9da474f.tar.gz |
Don't permit file uploads in read-only mode
Diffstat (limited to 'commands/webui.go')
-rw-r--r-- | commands/webui.go | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/commands/webui.go b/commands/webui.go index 7a0fb2cd..87ccf5d4 100644 --- a/commands/webui.go +++ b/commands/webui.go @@ -62,7 +62,9 @@ func runWebUI(cmd *cobra.Command, args []string) error { router.Path("/playground").Handler(playground.Handler("git-bug", "/graphql")) router.Path("/graphql").Handler(graphqlHandler) router.Path("/gitfile/{hash}").Handler(newGitFileHandler(repo)) - router.Path("/upload").Methods("POST").Handler(newGitUploadFileHandler(repo)) + if !webUIReadOnly { + router.Path("/upload").Methods("POST").Handler(newGitUploadFileHandler(repo)) + } router.PathPrefix("/").Handler(http.FileServer(assetsHandler)) srv := &http.Server{ |