From 43c78da02ecd2d49a45632e5b3270cd0c9da474f Mon Sep 17 00:00:00 2001 From: Luke Granger-Brown Date: Thu, 18 Jun 2020 03:11:24 +0100 Subject: Don't permit file uploads in read-only mode --- commands/webui.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'commands') diff --git a/commands/webui.go b/commands/webui.go index 7a0fb2cdc..87ccf5d4e 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{ -- cgit v1.2.3