From ca7cd0476c06b6285de27b4cf15fa643e4b31a2a Mon Sep 17 00:00:00 2001 From: Toby Chui Date: Sun, 6 Apr 2025 17:05:30 +0800 Subject: [PATCH] Updated location rewrite logic - Updated to a much more relax logic for handling domain with port redirection --- src/mod/dynamicproxy/dpcore/utils.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mod/dynamicproxy/dpcore/utils.go b/src/mod/dynamicproxy/dpcore/utils.go index edac154..a30f084 100644 --- a/src/mod/dynamicproxy/dpcore/utils.go +++ b/src/mod/dynamicproxy/dpcore/utils.go @@ -49,7 +49,7 @@ func replaceLocationHost(urlString string, rrr *ResponseRewriteRuleSet, useTLS b //That usually means the user have invalidly configured the web server to use port 80 or 443 //for http or https. We should not modify the location header in this case. - } else { + } else if strings.Contains(u.Host, ":") && err == nil { //Other port numbers. Do not modify location header return urlString, nil }