From f09fff3d8bbdc6c8f61f863d8821cbfa9e2b9851 Mon Sep 17 00:00:00 2001 From: Matthew Holt Date: Fri, 21 Apr 2017 22:26:38 -0600 Subject: [PATCH] Remove ineffectual assignment created by reverting 344017d (#1584) --- caddyhttp/proxy/reverseproxy.go | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/caddyhttp/proxy/reverseproxy.go b/caddyhttp/proxy/reverseproxy.go index 056a19422..eb0f63e8e 100644 --- a/caddyhttp/proxy/reverseproxy.go +++ b/caddyhttp/proxy/reverseproxy.go @@ -25,7 +25,6 @@ import ( "golang.org/x/net/http2" "github.com/mholt/caddy/caddyhttp/httpserver" - "github.com/mholt/caddy/caddyhttp/staticfiles" ) var ( @@ -121,7 +120,8 @@ func NewSingleHostReverseProxy(target *url.URL, without string, keepalive int) * } // We should remove the `without` prefix at first. - untouchedPath, _ := req.Context().Value(staticfiles.URLPathCtxKey).(string) + // TODO(mholt): See #1582 (and below) + // untouchedPath, _ := req.Context().Value(staticfiles.URLPathCtxKey).(string) if without != "" { req.URL.Path = strings.TrimPrefix(req.URL.Path, without) if req.URL.Opaque != "" { @@ -130,9 +130,10 @@ func NewSingleHostReverseProxy(target *url.URL, without string, keepalive int) * if req.URL.RawPath != "" { req.URL.RawPath = strings.TrimPrefix(req.URL.RawPath, without) } - if untouchedPath != "" { - untouchedPath = strings.TrimPrefix(untouchedPath, without) - } + // TODO(mholt): See #1582 (and above) + // if untouchedPath != "" { + // untouchedPath = strings.TrimPrefix(untouchedPath, without) + // } } // prefer returns val if it isn't empty, otherwise def