response: Ensure that only one header is written
This commit is contained in:
parent
33a1fa4e0d
commit
9ed2363b66
@ -219,6 +219,10 @@ func (w *responseWriter) Write(b []byte) (int, error) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (w *responseWriter) WriteHeader(statusCode int, meta string) {
|
func (w *responseWriter) WriteHeader(statusCode int, meta string) {
|
||||||
|
if w.wroteHeader {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
if StatusClass(statusCode) == StatusSuccess {
|
if StatusClass(statusCode) == StatusSuccess {
|
||||||
w.bodyAllowed = true
|
w.bodyAllowed = true
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user