adjust for go1.17

This commit is contained in:
Arthur Morgan 2021-09-08 01:30:20 +08:00
parent 3213e5dd81
commit e6019a89c9
2 changed files with 3 additions and 3 deletions

View File

@ -90,7 +90,7 @@ func (h *HeaderReader) Read(reader io.Reader) (*buf.Buffer, error) {
buffer.Clear()
copy(buffer.Extend(lenEnding), leftover)
if _, err := readRequest(bufio.NewReader(bytes.NewReader(headerBuf.Bytes())), false); err != io.ErrUnexpectedEOF {
if _, err := readRequest(bufio.NewReader(bytes.NewReader(headerBuf.Bytes()))); err != io.ErrUnexpectedEOF {
return nil, err
}
}
@ -110,7 +110,7 @@ func (h *HeaderReader) Read(reader io.Reader) (*buf.Buffer, error) {
}
// Parse the request
if req, err := readRequest(bufio.NewReader(bytes.NewReader(headerBuf.Bytes())), false); err != nil {
if req, err := readRequest(bufio.NewReader(bytes.NewReader(headerBuf.Bytes()))); err != nil {
return nil, err
} else {
h.req = req

View File

@ -8,4 +8,4 @@ import (
)
//go:linkname readRequest net/http.readRequest
func readRequest(b *bufio.Reader, deleteHostHeader bool) (req *http.Request, err error)
func readRequest(b *bufio.Reader) (req *http.Request, err error)