diff options
-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{ |