From f3655422288985aa8c3113043b45edf120fe3b72 Mon Sep 17 00:00:00 2001 From: Harshavardhana Date: Tue, 22 Sep 2015 02:11:03 -0700 Subject: [PATCH] Make sure that if we find the exact match reply quickly, do not go through globURL ref #1111 --- config.go | 3 ++- hostconfig.go | 3 +++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/config.go b/config.go index f7739a90..88f1dc92 100644 --- a/config.go +++ b/config.go @@ -152,7 +152,8 @@ func getMcConfig() (*configV5, *probe.Error) { return v.(quick.Config).Data().(*configV5), nil } - conf := newConfigV5() + conf := new(configV5) + conf.Version = globalMCConfigVersion qconf, err := quick.New(conf) if err != nil { return nil, err.Trace() diff --git a/hostconfig.go b/hostconfig.go index 348ecedc..33cd5b01 100644 --- a/hostconfig.go +++ b/hostconfig.go @@ -45,6 +45,9 @@ func getHostConfig(URL string) (hostConfig, *probe.Error) { } return hostCfg, nil } + if _, ok := config.Hosts[url.Host]; ok { + return config.Hosts[url.Host], nil + } for globURL, hostCfg := range config.Hosts { match, err := filepath.Match(globURL, url.Host) if err != nil {