chore: add more tests (#3084)

This commit is contained in:
Kevin Wan
2023-03-31 22:33:43 +08:00
committed by GitHub
parent e06abf4f6f
commit 8d0cceb80c
2 changed files with 49 additions and 0 deletions

View File

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