diff options
Diffstat (limited to 'api/context.go')
-rw-r--r-- | api/context.go | 4 |
1 files changed, 4 insertions, 0 deletions
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() } |