Commit f09fff3d authored by Matthew Holt's avatar Matthew Holt

Remove ineffectual assignment created by reverting 344017dc (#1584)

parent 0a798aaf
...@@ -25,7 +25,6 @@ import ( ...@@ -25,7 +25,6 @@ import (
"golang.org/x/net/http2" "golang.org/x/net/http2"
"github.com/mholt/caddy/caddyhttp/httpserver" "github.com/mholt/caddy/caddyhttp/httpserver"
"github.com/mholt/caddy/caddyhttp/staticfiles"
) )
var ( var (
...@@ -121,7 +120,8 @@ func NewSingleHostReverseProxy(target *url.URL, without string, keepalive int) * ...@@ -121,7 +120,8 @@ func NewSingleHostReverseProxy(target *url.URL, without string, keepalive int) *
} }
// We should remove the `without` prefix at first. // 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 != "" { if without != "" {
req.URL.Path = strings.TrimPrefix(req.URL.Path, without) req.URL.Path = strings.TrimPrefix(req.URL.Path, without)
if req.URL.Opaque != "" { if req.URL.Opaque != "" {
...@@ -130,9 +130,10 @@ func NewSingleHostReverseProxy(target *url.URL, without string, keepalive int) * ...@@ -130,9 +130,10 @@ func NewSingleHostReverseProxy(target *url.URL, without string, keepalive int) *
if req.URL.RawPath != "" { if req.URL.RawPath != "" {
req.URL.RawPath = strings.TrimPrefix(req.URL.RawPath, without) req.URL.RawPath = strings.TrimPrefix(req.URL.RawPath, without)
} }
if untouchedPath != "" { // TODO(mholt): See #1582 (and above)
untouchedPath = strings.TrimPrefix(untouchedPath, without) // if untouchedPath != "" {
} // untouchedPath = strings.TrimPrefix(untouchedPath, without)
// }
} }
// prefer returns val if it isn't empty, otherwise def // prefer returns val if it isn't empty, otherwise def
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment