mirror of
https://github.com/gin-gonic/gin.git
synced 2025-10-16 05:16:35 +08:00
Merge 5f80e0a7dce5baed4a2e1ea377347b515b872adb into 8659ab573cf7d26b2fa2a41e90075d84606188f1
This commit is contained in:
commit
94af4a9f26
@ -59,10 +59,11 @@ func (w *responseWriter) reset(writer http.ResponseWriter) {
|
||||
|
||||
func (w *responseWriter) WriteHeader(code int) {
|
||||
if code > 0 && w.status != code {
|
||||
w.status = code
|
||||
if w.Written() {
|
||||
debugPrint("[WARNING] Headers were already written. Wanted to override status code %d with %d", w.status, code)
|
||||
w.ResponseWriter.WriteHeader(code)
|
||||
}
|
||||
w.status = code
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user