response: Ensure that only one header is written

This commit is contained in:
Adnan Maolood 2021-02-17 23:05:22 -05:00
parent 33a1fa4e0d
commit 9ed2363b66

View File

@ -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
}