make sure setting code happen before callback in rest (#936)

master
Kevin Wan 3 years ago committed by GitHub
parent bf3ce16823
commit 9672298fa8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -112,11 +112,12 @@ func unauthorized(w http.ResponseWriter, r *http.Request, err error, callback Un
} else {
detailAuthLog(r, noDetailReason)
}
writer.WriteHeader(http.StatusUnauthorized)
if callback != nil {
callback(writer, r, err)
}
writer.WriteHeader(http.StatusUnauthorized)
}
type guardedResponseWriter struct {

Loading…
Cancel
Save