vhost: check host and location for url router

This commit is contained in:
fatedier
2016-12-27 01:01:39 +08:00
parent 8bf61d5e39
commit 04a4591caa
3 changed files with 27 additions and 3 deletions

View File

@@ -56,6 +56,11 @@ func (v *VhostMuxer) Listen(name, location, rewriteHost, userName, passWord stri
v.mutex.Lock()
defer v.mutex.Unlock()
_, ok := v.registryRouter.Exist(name, location)
if ok {
return nil, fmt.Errorf("hostname [%s] location [%s] is already registered", name, location)
}
l = &Listener{
name: name,
rewriteHost: rewriteHost,