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) {
|
||||
if w.wroteHeader {
|
||||
return
|
||||
}
|
||||
|
||||
if StatusClass(statusCode) == StatusSuccess {
|
||||
w.bodyAllowed = true
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user