1
0
mirror of https://github.com/kataras/iris.git synced 2026-01-07 12:07:28 +00:00

Parse server's addr before use it

This commit is contained in:
Makis Maropoulos
2016-07-07 17:17:34 +02:00
parent 981fef9ecf
commit e3b2c68085
5 changed files with 100 additions and 56 deletions

View File

@@ -220,7 +220,7 @@ func (ctx *Context) HostString() string {
func (ctx *Context) VirtualHostname() string {
realhost := ctx.HostString()
hostname := realhost
virtualhost := ctx.framework.Servers.Main().VirtualHostname()
virtualhost := ctx.framework.Servers.Main().Hostname()
if portIdx := strings.IndexByte(hostname, ':'); portIdx > 0 {
hostname = hostname[0:portIdx]