mirror of
https://github.com/kataras/iris.git
synced 2025-02-02 15:30:36 +01:00
see prev commit
This commit is contained in:
parent
227170fd33
commit
177b05b674
|
@ -150,6 +150,7 @@ func (s *subdomainRedirectWrapper) Wrapper(w http.ResponseWriter, r *http.Reques
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Think of another way. As it's a breaking change.
|
||||||
if s.isFromRoot && !s.isFromAny {
|
if s.isFromRoot && !s.isFromAny {
|
||||||
// Then we must not continue,
|
// Then we must not continue,
|
||||||
// the subdomain didn't match the "to" but the from
|
// the subdomain didn't match the "to" but the from
|
||||||
|
@ -159,8 +160,9 @@ func (s *subdomainRedirectWrapper) Wrapper(w http.ResponseWriter, r *http.Reques
|
||||||
// http://registered_host_but_not_in_app.your.mydomain.com
|
// http://registered_host_but_not_in_app.your.mydomain.com
|
||||||
http.NotFound(w, r)
|
http.NotFound(w, r)
|
||||||
return
|
return
|
||||||
|
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
// the from subdomain is not matched and it's not from root.
|
// the from subdomain is not matched and it's not from root.
|
||||||
router(w, r)
|
router(w, r)
|
||||||
return
|
return
|
||||||
|
|
|
@ -188,7 +188,11 @@ func (l MemoryLocalizer) GetLocale(index int) context.Locale {
|
||||||
index = 0
|
index = 0
|
||||||
}
|
}
|
||||||
|
|
||||||
return l[index]
|
if locale, ok := l[index]; ok {
|
||||||
|
return locale
|
||||||
|
}
|
||||||
|
|
||||||
|
return l[0]
|
||||||
}
|
}
|
||||||
|
|
||||||
// SetDefault changes the default language based on the "index".
|
// SetDefault changes the default language based on the "index".
|
||||||
|
|
Loading…
Reference in New Issue
Block a user