优化代码

This commit is contained in:
刘祥超
2021-05-23 16:16:56 +08:00
parent df5f50682a
commit 4c73b3618f
3 changed files with 30 additions and 9 deletions

View File

@@ -7,7 +7,6 @@ import (
"github.com/TeaOSLab/EdgeCommon/pkg/serverconfigs/shared"
"github.com/TeaOSLab/EdgeNode/internal/remotelogs"
"github.com/TeaOSLab/EdgeNode/internal/utils"
"golang.org/x/net/http2"
"io"
"net/url"
"strconv"
@@ -257,13 +256,13 @@ func (this *HTTPRequest) doReverseProxy() {
err1 := resp.Body.Close()
if err1 != nil {
if _, ok := err1.(http2.StreamError); !ok {
if !this.canIgnore(err) {
remotelogs.Error("REQUEST_REVERSE_PROXY", err1.Error())
}
}
if err != nil && err != io.EOF {
if _, ok := err.(http2.StreamError); !ok {
if !this.canIgnore(err) {
remotelogs.Error("REQUEST_REVERSE_PROXY", err.Error())
this.addError(err)
}