Skip to content

Commit

Permalink
feat: add end chunk even if read error
Browse files Browse the repository at this point in the history
  • Loading branch information
welkeyever committed Aug 8, 2023
1 parent bf39157 commit d32681d
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions pkg/protocol/http1/ext/common.go
Original file line number Diff line number Diff line change
Expand Up @@ -117,12 +117,10 @@ func WriteBodyChunked(w network.Writer, r io.Reader) error {
if err == nil {
panic("BUG: io.Reader returned 0, nil")
}
if err == io.EOF {
if err = WriteChunk(w, buf[:0], true); err != nil {
break
}
err = nil
if err = WriteChunk(w, buf[:0], true); err != nil {
break
}
err = nil
break
}
if err = WriteChunk(w, buf[:n], true); err != nil {
Expand Down

0 comments on commit d32681d

Please sign in to comment.