From e5e88d16049f4527eaab6b066c731fbe4247b574 Mon Sep 17 00:00:00 2001 From: =Corey Hulen Date: Fri, 11 Sep 2015 09:39:28 -0700 Subject: Renaming ROLE_ADMIN to ROLE_TEAM_ADMIN --- api/context.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'api/context.go') diff --git a/api/context.go b/api/context.go index 1852ed4d6..8e5becda7 100644 --- a/api/context.go +++ b/api/context.go @@ -298,7 +298,7 @@ func (c *Context) IsTeamAdmin(userId string) bool { return false } else { user := uresult.Data.(*model.User) - return model.IsInRole(c.Session.Roles, model.ROLE_ADMIN) && user.TeamId == c.Session.TeamId + return model.IsInRole(c.Session.Roles, model.ROLE_TEAM_ADMIN) && user.TeamId == c.Session.TeamId } } -- cgit v1.2.3-1-g7c22 From 27e59c32f933e6b52a01a73b774e6b0ade0d1d4d Mon Sep 17 00:00:00 2001 From: JoramWilander Date: Fri, 11 Sep 2015 12:11:10 -0400 Subject: Set default Content-Type to application/json for all API requests --- api/context.go | 3 +++ 1 file changed, 3 insertions(+) (limited to 'api/context.go') diff --git a/api/context.go b/api/context.go index aaf304e2c..ac5dbc7ec 100644 --- a/api/context.go +++ b/api/context.go @@ -106,6 +106,9 @@ func (h handler) ServeHTTP(w http.ResponseWriter, r *http.Request) { if !h.isApi { w.Header().Set("X-Frame-Options", "DENY") w.Header().Set("Content-Security-Policy", "frame-ancestors none") + } else { + // All api response bodies will be JSON formatted + w.Header().Set("Content-Type", "application/json") } sessionId := "" -- cgit v1.2.3-1-g7c22