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 { } else {
detailAuthLog(r, noDetailReason) detailAuthLog(r, noDetailReason)
} }
writer.WriteHeader(http.StatusUnauthorized)
if callback != nil { if callback != nil {
callback(writer, r, err) callback(writer, r, err)
} }
writer.WriteHeader(http.StatusUnauthorized)
} }
type guardedResponseWriter struct { type guardedResponseWriter struct {

Loading…
Cancel
Save