mirror of
https://github.com/tobychui/zoraxy.git
synced 2025-08-06 21:28:30 +02:00
bug fixes for 2.6.5
+ Added potential fixes for #34 and #39 + Added better error handling for #43
This commit is contained in:
@@ -21,6 +21,15 @@ func replaceLocationHost(urlString string, rrr *ResponseRewriteRuleSet, useTLS b
|
||||
u.Scheme = "http"
|
||||
}
|
||||
|
||||
//Issue #39: Check if it is location target match the proxying domain
|
||||
//E.g. Proxy config: blog.example.com -> example.com/blog
|
||||
//Check if it is actually redirecting to example.com instead of a new domain
|
||||
//like news.example.com.
|
||||
if rrr.ProxyDomain != u.Host {
|
||||
//New location domain not matching proxy target domain.
|
||||
//Do not modify location header
|
||||
return urlString, nil
|
||||
}
|
||||
u.Host = rrr.OriginalHost
|
||||
|
||||
if strings.Contains(rrr.ProxyDomain, "/") {
|
||||
|
Reference in New Issue
Block a user