From b68e6517dfe0fb76b544df912d6e55d085393bcc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=88=98=E7=A5=A5=E8=B6=85?= Date: Mon, 5 Jun 2023 17:06:03 +0800 Subject: [PATCH] =?UTF-8?q?=E7=BD=91=E7=AB=99=E5=85=A8=E5=B1=80=E8=AE=BE?= =?UTF-8?q?=E7=BD=AE=E5=A2=9E=E5=8A=A0=E2=80=9C=E5=BC=BA=E5=88=B6Ln?= =?UTF-8?q?=E8=AF=B7=E6=B1=82=E2=80=9C=E9=80=89=E9=A1=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- internal/nodes/http_request_reverse_proxy.go | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/internal/nodes/http_request_reverse_proxy.go b/internal/nodes/http_request_reverse_proxy.go index 2f406c9..7e65e55 100644 --- a/internal/nodes/http_request_reverse_proxy.go +++ b/internal/nodes/http_request_reverse_proxy.go @@ -66,19 +66,21 @@ func (this *HTTPRequest) doOriginRequest(failedOriginIds []int64, failedLnNodeId // 二级节点 var hasMultipleLnNodes = false - if this.cacheRef != nil { + if this.cacheRef != nil || (this.nodeConfig != nil && this.nodeConfig.GlobalServerConfig != nil && this.nodeConfig.GlobalServerConfig.HTTPAll.ForceLnRequest) { origin, lnNodeId, hasMultipleLnNodes = this.getLnOrigin(failedLnNodeIds) if origin != nil { // 强制变更原来访问的域名 requestHost = this.ReqHost } - // 回源Header中去除If-None-Match和If-Modified-Since - if !this.cacheRef.EnableIfNoneMatch { - this.DeleteHeader("If-None-Match") - } - if !this.cacheRef.EnableIfModifiedSince { - this.DeleteHeader("If-Modified-Since") + if this.cacheRef != nil { + // 回源Header中去除If-None-Match和If-Modified-Since + if !this.cacheRef.EnableIfNoneMatch { + this.DeleteHeader("If-None-Match") + } + if !this.cacheRef.EnableIfModifiedSince { + this.DeleteHeader("If-Modified-Since") + } } }