We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent c977145 commit e482896Copy full SHA for e482896
response.go
@@ -741,6 +741,7 @@ type lenReadSeeker interface {
741
type dummyReadCloser struct {
742
orig any // string or []byte
743
body lenReadSeeker // instanciated on demand from orig
744
+ mu sync.Mutex
745
}
746
747
// copy returns a new instance resetting d.body to nil.
@@ -771,6 +772,9 @@ func (d *dummyReadCloser) Read(p []byte) (n int, err error) {
771
772
773
774
func (d *dummyReadCloser) Close() error {
775
+ d.mu.Lock()
776
+ defer d.mu.Unlock()
777
+
778
d.setup()
779
d.body.Seek(0, io.SeekEnd) //nolint: errcheck
780
return nil
0 commit comments