From ae56c1744e833a4b8646b53c0daf024c835421f8 Mon Sep 17 00:00:00 2001 From: Bel LaPointe Date: Wed, 6 Mar 2019 09:41:16 -0700 Subject: [PATCH] allow localhost->localhost base proxying --- server/proxy.go | 1 + server/proxy_test.go | 3 +++ 2 files changed, 4 insertions(+) create mode 100644 server/proxy_test.go diff --git a/server/proxy.go b/server/proxy.go index 9b14904..e9740d3 100644 --- a/server/proxy.go +++ b/server/proxy.go @@ -23,6 +23,7 @@ func (s *Server) Proxy(w http.ResponseWriter, r *http.Request) { func (s *Server) lookup(host string) (*url.URL, error) { host = strings.Split(host, ".")[0] + host = strings.Split(host, ":")[0] v := packable.NewURL() err := s.db.Get(nsRouting, host, v) return v.URL(), err diff --git a/server/proxy_test.go b/server/proxy_test.go new file mode 100644 index 0000000..51ff208 --- /dev/null +++ b/server/proxy_test.go @@ -0,0 +1,3 @@ +package server + +// empty url -> OK //TODO