mirror of
https://github.com/kataras/iris.git
synced 2026-01-08 12:31:58 +00:00
fix SubdomainRedirect on loopbacks
fix: https://github.com/kataras/iris/issues/1584#issuecomment-674001454
This commit is contained in:
@@ -112,6 +112,10 @@ func (s *subdomainRedirectWrapper) Wrapper(w http.ResponseWriter, r *http.Reques
|
||||
|
||||
host := context.GetHost(r)
|
||||
root := s.root()
|
||||
if loopback := netutil.GetLoopbackSubdomain(root); loopback != "" {
|
||||
root = strings.Replace(root, loopback, context.GetDomain(host), 1)
|
||||
}
|
||||
// println("root: " + root)
|
||||
hasSubdomain := host != root
|
||||
|
||||
if !hasSubdomain && !s.isFromRoot {
|
||||
|
||||
Reference in New Issue
Block a user