47 lines
1.9 KiB
Diff
47 lines
1.9 KiB
Diff
From 77b88171d6bd837b76a5ad6e6b23689391530ed6 Mon Sep 17 00:00:00 2001
|
|
From: =?UTF-8?q?=E6=9C=B1=E8=81=96=E9=BB=8E=20=28Zhu=20Sheng=20Li=29?=
|
|
<digglife@gmail.com>
|
|
Date: Sat, 6 Nov 2021 22:09:26 +0800
|
|
Subject: [PATCH] fix: readRequest API changed since go1.17 (#1370)
|
|
|
|
fixed: #1265
|
|
---
|
|
transport/internet/headers/http/http.go | 4 ++--
|
|
transport/internet/headers/http/linkedreadRequest.go | 2 +-
|
|
2 files changed, 3 insertions(+), 3 deletions(-)
|
|
|
|
diff --git a/transport/internet/headers/http/http.go b/transport/internet/headers/http/http.go
|
|
index c73f7a63..54611889 100644
|
|
--- a/transport/internet/headers/http/http.go
|
|
+++ b/transport/internet/headers/http/http.go
|
|
@@ -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 { // nolint: golint
|
|
h.req = req
|
|
diff --git a/transport/internet/headers/http/linkedreadRequest.go b/transport/internet/headers/http/linkedreadRequest.go
|
|
index 35154b87..45773312 100644
|
|
--- a/transport/internet/headers/http/linkedreadRequest.go
|
|
+++ b/transport/internet/headers/http/linkedreadRequest.go
|
|
@@ -9,4 +9,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)
|
|
--
|
|
2.33.1
|
|
|