From 4b2fed1f76427a66b3335780e907e8a306e4fa4c Mon Sep 17 00:00:00 2001 From: George Shaw Date: Mon, 11 Dec 2017 13:38:13 -0600 Subject: [PATCH] unlock was in the wrong place for mutex in router --- pkg/router/router.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/router/router.go b/pkg/router/router.go index e288a39..a7922f9 100644 --- a/pkg/router/router.go +++ b/pkg/router/router.go @@ -59,11 +59,11 @@ func New() *Router { Director: func(req *http.Request) { mutex.Lock() if d, ok := domainToPort[req.Host]; ok { + mutex.Unlock() req.Header.Set("Host", req.Host) req.URL.Scheme = "http" req.URL.Host = "127.0.0.1:" + strconv.Itoa(d) } - mutex.Unlock() }, }, ReadTimeout: 5 * time.Second,