Skip to content
This repository was archived by the owner on Nov 28, 2024. It is now read-only.

Fix writeBody may get panic because of nil w.partWriter #64

Open
wants to merge 1 commit into
base: v2
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions writeto.go
Original file line number Diff line number Diff line change
Expand Up @@ -258,6 +258,10 @@ func (w *messageWriter) writeHeaders(h map[string][]string) {
}

func (w *messageWriter) writeBody(f func(io.Writer) error, enc Encoding) {
if w.err != nil {
return
}

var subWriter io.Writer
if w.depth == 0 {
w.writeString("\r\n")
Expand Down