Set default Content-Type to application/json for all API requests

Этот коммит содержится в:
JoramWilander
2015-09-11 12:11:10 -04:00
родитель 7f491bdb17
Коммит 27e59c32f9

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

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