From 63e3b7ac2f367fcaf96419853736ea61544fb2a2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=88=98=E7=A5=A5=E8=B6=85?= Date: Sat, 22 May 2021 10:26:37 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E8=B7=B3=E8=BD=AC=E5=88=B0HT?= =?UTF-8?q?TPS=E7=9A=84=E8=87=AA=E5=AE=9A=E4=B9=89=E7=AB=AF=E5=8F=A3?= =?UTF-8?q?=E6=97=A0=E6=B3=95=E8=B5=B7=E4=BD=9C=E7=94=A8=E7=9A=84Bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- internal/nodes/http_request_redirect_https.go | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/internal/nodes/http_request_redirect_https.go b/internal/nodes/http_request_redirect_https.go index 2cc4321..19ca9b9 100644 --- a/internal/nodes/http_request_redirect_https.go +++ b/internal/nodes/http_request_redirect_https.go @@ -19,11 +19,10 @@ func (this *HTTPRequest) doRedirectToHTTPS(redirectToHTTPSConfig *serverconfigs. } else if redirectToHTTPSConfig.Port > 0 { lastIndex := strings.LastIndex(host, ":") if lastIndex > 0 { - if redirectToHTTPSConfig.Port != 443 { - host = host[:lastIndex] + ":" + strconv.Itoa(redirectToHTTPSConfig.Port) - } else { - host = host[:lastIndex] - } + host = host[:lastIndex] + } + if redirectToHTTPSConfig.Port != 443 { + host = host + ":" + strconv.Itoa(redirectToHTTPSConfig.Port) } } else { lastIndex := strings.LastIndex(host, ":")