TUN-3505: Response body for status code origin returns EOF on Read

This commit is contained in:
cthuang
2020-11-05 13:37:30 +00:00
parent bc015995d8
commit b00bfe8e0b
2 changed files with 13 additions and 2 deletions

View File

@@ -4,6 +4,7 @@ import (
"context"
"crypto/tls"
"fmt"
"io"
"net"
"net/http"
"net/url"
@@ -252,8 +253,9 @@ func (o *statusCode) RoundTrip(_ *http.Request) (*http.Response, error) {
type NopReadCloser struct{}
// Read always returns EOF to signal end of input
func (nrc *NopReadCloser) Read(buf []byte) (int, error) {
return 0, nil
return 0, io.EOF
}
func (nrc *NopReadCloser) Close() error {