Skip to content

Commit

Permalink
Write needs a write lock
Browse files Browse the repository at this point in the history
  • Loading branch information
dmathieu committed Jul 24, 2024
1 parent a9d231d commit 01a1bb1
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@ func NewRespWriterWrapper(w http.ResponseWriter, onWrite func(int64)) *RespWrite
// Write writes the bytes array into the [ResponseWriter], and tracks the
// number of bytes written and last error.
func (w *RespWriterWrapper) Write(p []byte) (int, error) {
w.mu.RLock()
defer w.mu.RUnlock()
w.mu.Lock()
defer w.mu.Unlock()

w.writeHeader(http.StatusOK)

Expand Down

0 comments on commit 01a1bb1

Please sign in to comment.