MM-15835: correct errors and content types for oauth api calls (#10999)

* MM-15835: correct errors and content types for oauth api calls

* Addressing PR review comments
Этот коммит содержится в:
Jesús Espino
2019-05-30 19:23:26 +02:00
коммит произвёл Joram Wilander
родитель ae6fed827a
Коммит 4de81fa94c
3 изменённых файлов: 18 добавлений и 3 удалений

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

@@ -195,7 +195,7 @@ func (h Handler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
c.Err.IsOAuth = false
}
if IsApiCall(c.App, r) || IsWebhookCall(c.App, r) || len(r.Header.Get("X-Mobile-App")) > 0 {
if IsApiCall(c.App, r) || IsWebhookCall(c.App, r) || IsOAuthApiCall(c.App, r) || len(r.Header.Get("X-Mobile-App")) > 0 {
w.WriteHeader(c.Err.StatusCode)
w.Write([]byte(c.Err.ToJson()))
} else {