Update sniff parser to fix index out of bound error

This commit is contained in:
Manuel de Brito Fontes 2017-05-26 14:25:06 -04:00
parent e4c4b22c73
commit 20e99fa409
4 changed files with 41 additions and 37 deletions

View file

@ -22,6 +22,10 @@ type proxy struct {
}
func (p *proxy) Get(host string) *server {
if p.ServerList == nil {
return p.Default
}
for _, s := range p.ServerList {
if s.Hostname == host {
return s