mirror of
https://github.com/zeromicro/go-zero.git
synced 2025-01-23 09:00:20 +08:00
make sure setting code happen before callback in rest (#936)
This commit is contained in:
parent
bf3ce16823
commit
9672298fa8
@ -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…
Reference in New Issue
Block a user