From 8ec8948c84e946fde736add0c4e6dd55f6efd1ab Mon Sep 17 00:00:00 2001 From: Joram Wilander Date: Tue, 4 Jul 2017 16:12:02 -0400 Subject: PLT-6554 Add config setting to control enabling API version 3 (#6835) * Add config setting to control enabling API version 3 * Update help text for APIv3 config setting (#6843) * Update configuration_settings.jsx * Update en.json --- api/context.go | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'api/context.go') diff --git a/api/context.go b/api/context.go index 6d1e758e8..09cb1e583 100644 --- a/api/context.go +++ b/api/context.go @@ -205,6 +205,10 @@ func (h handler) ServeHTTP(w http.ResponseWriter, r *http.Request) { c.Path = "/" + strings.Join(splitURL[2:], "/") } + if h.isApi && !*utils.Cfg.ServiceSettings.EnableAPIv3 { + c.Err = model.NewAppError("ServeHTTP", "api.context.v3_disabled.app_error", nil, "", http.StatusNotImplemented) + } + if c.Err == nil && h.requireUser { c.UserRequired() } -- cgit v1.2.3-1-g7c22