Merge pull request #655 from mattermost/content-type

Set default Content-Type to application/json for all API requests
Этот коммит содержится в:
Christopher Speller
2015-09-14 08:19:51 -04:00
родитель a9a7efbe98 27e59c32f9
Коммит 447363262e

Просмотреть файл

@@ -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 := ""