summaryrefslogtreecommitdiffstats
path: root/api
diff options
context:
space:
mode:
authorChristopher Speller <crspeller@gmail.com>2016-07-19 12:40:13 -0400
committerCorey Hulen <corey@hulen.com>2016-07-19 08:40:13 -0800
commit24bef929dc7cce8ed1f776863de7b3329aa18e37 (patch)
tree537fcbc9dee16f15b20d37a8679d15e20ff88064 /api
parente1de41cc81fa2c083c3464c62ea9fe4518f8661e (diff)
downloadchat-24bef929dc7cce8ed1f776863de7b3329aa18e37.tar.gz
chat-24bef929dc7cce8ed1f776863de7b3329aa18e37.tar.bz2
chat-24bef929dc7cce8ed1f776863de7b3329aa18e37.zip
Restricting visibility of detailed_error message (#3629)
Diffstat (limited to 'api')
-rw-r--r--api/context.go6
1 files changed, 6 insertions, 0 deletions
diff --git a/api/context.go b/api/context.go
index 2132ce0e7..b26778711 100644
--- a/api/context.go
+++ b/api/context.go
@@ -204,12 +204,18 @@ func (h handler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
h.handleFunc(c, w, r)
}
+ // Handle errors that have occoured
if c.Err != nil {
c.Err.Translate(c.T)
c.Err.RequestId = c.RequestId
c.LogError(c.Err)
c.Err.Where = r.URL.Path
+ // Block out detailed error whenn not in developer mode
+ if !*utils.Cfg.ServiceSettings.EnableDeveloper {
+ c.Err.DetailedError = ""
+ }
+
if h.isApi {
w.WriteHeader(c.Err.StatusCode)
w.Write([]byte(c.Err.ToJson()))