1
0
Fork 0

Retry should send headers on Write

Co-authored-by: Romain <rtribotte@users.noreply.github.com>
This commit is contained in:
Kevin Pollet 2025-02-21 10:52:04 +01:00 committed by GitHub
parent 8e5d4c6ae9
commit c2a294c872
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 40 additions and 18 deletions

View file

@ -196,6 +196,9 @@ func (r *responseWriterWithoutCloseNotify) Write(buf []byte) (int, error) {
if r.ShouldRetry() {
return len(buf), nil
}
if !r.written {
r.WriteHeader(http.StatusOK)
}
return r.responseWriter.Write(buf)
}