🐛 Fixed writing headers order in media HTTP delivery layer

This commit is contained in:
Maxim Lebedev 2023-09-30 20:10:32 +06:00
parent aeba4bbb8a
commit dcfc62e081
Signed by: toby3d
GPG Key ID: 1F14E25B7C119FC5

View File

@ -117,8 +117,8 @@ func WriteError(w http.ResponseWriter, description string, status int) {
out.Error = "unauthorized"
}
_ = json.NewEncoder(w).Encode(out)
w.Header().Set(common.HeaderContentType, common.MIMEApplicationJSONCharsetUTF8)
w.WriteHeader(status)
_ = json.NewEncoder(w).Encode(out)
}