fixbug:superfluous response.WriteHeader (#3083)

master
heyehang 2 years ago committed by GitHub
parent ee555a85da
commit e06abf4f6f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -183,7 +183,9 @@ func (tw *timeoutWriter) writeHeaderLocked(code int) {
func (tw *timeoutWriter) WriteHeader(code int) { func (tw *timeoutWriter) WriteHeader(code int) {
tw.mu.Lock() tw.mu.Lock()
defer tw.mu.Unlock() defer tw.mu.Unlock()
if !tw.wroteHeader {
tw.writeHeaderLocked(code) tw.writeHeaderLocked(code)
}
} }
func checkWriteHeaderCode(code int) { func checkWriteHeaderCode(code int) {

Loading…
Cancel
Save