1
0
mirror of https://github.com/astaxie/beego.git synced 2024-12-22 21:30:49 +00:00

SubDomains function bugfixed

This commit is contained in:
xuewuhen 2014-11-18 22:54:48 +08:00
parent cec151fda7
commit c9bb9d6a09

View File

@ -194,7 +194,7 @@ func (input *BeegoInput) Refer() string {
// if aa.bb.domain.com, returns aa.bb .
func (input *BeegoInput) SubDomains() string {
parts := strings.Split(input.Host(), ".")
return strings.Join(parts[len(parts)-2:], ".")
return strings.Join(parts[:len(parts)-2], ".")
}
// Port returns request client port.