From 19653b115cb3f8ccb0d700fb22b1c9f32dfca22b Mon Sep 17 00:00:00 2001 From: GoEdgeLab Date: Sun, 7 May 2023 09:28:18 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A6=82=E6=9E=9C=E7=AE=A1=E7=90=86=E7=B3=BB?= =?UTF-8?q?=E7=BB=9F=E5=89=8D=E7=AB=AF=E6=9C=89=E5=8F=8D=E5=90=91=E4=BB=A3?= =?UTF-8?q?=E7=90=86=EF=BC=8C=E5=88=99=E4=B8=8D=E8=A6=81=E8=87=AA=E5=8A=A8?= =?UTF-8?q?=E4=BB=8EHTTP=E8=B7=B3=E8=BD=AC=E5=88=B0HTTPS?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- internal/web/actions/default/index/index.go | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/internal/web/actions/default/index/index.go b/internal/web/actions/default/index/index.go index c84c3f48..100e0534 100644 --- a/internal/web/actions/default/index/index.go +++ b/internal/web/actions/default/index/index.go @@ -50,8 +50,11 @@ func (this *IndexAction) RunGet(params struct { newHost += ":" + types.String(httpsPort) } - this.RedirectURL("https://" + newHost + this.Request.RequestURI) - return + // 如果没有前端反向代理,则跳转 + if len(this.Request.Header.Get("X-Forwarded-For")) == 0 && len(this.Request.Header.Get("X-Real-Ip")) == 0 { + this.RedirectURL("https://" + newHost + this.Request.RequestURI) + return + } } }