mirror of
https://github.com/caddyserver/caddy.git
synced 2025-01-21 09:55:45 +03:00
Revert 344017dc21
(#1584)
This commit is contained in:
parent
182e1b4fb2
commit
f8614b877d
2 changed files with 1 additions and 9 deletions
|
@ -26,7 +26,6 @@ import (
|
||||||
|
|
||||||
"github.com/mholt/caddy/caddyfile"
|
"github.com/mholt/caddy/caddyfile"
|
||||||
"github.com/mholt/caddy/caddyhttp/httpserver"
|
"github.com/mholt/caddy/caddyhttp/httpserver"
|
||||||
"github.com/mholt/caddy/caddyhttp/staticfiles"
|
|
||||||
|
|
||||||
"golang.org/x/net/websocket"
|
"golang.org/x/net/websocket"
|
||||||
)
|
)
|
||||||
|
@ -995,8 +994,6 @@ func TestProxyDirectorURL(t *testing.T) {
|
||||||
t.Errorf("case %d failed to create request: %s", i, err)
|
t.Errorf("case %d failed to create request: %s", i, err)
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
req = req.WithContext(context.WithValue(req.Context(),
|
|
||||||
staticfiles.URLPathCtxKey, c.originalPath))
|
|
||||||
|
|
||||||
NewSingleHostReverseProxy(targetURL, c.without, 0).Director(req)
|
NewSingleHostReverseProxy(targetURL, c.without, 0).Director(req)
|
||||||
if expect, got := c.expectURL, req.URL.String(); expect != got {
|
if expect, got := c.expectURL, req.URL.String(); expect != got {
|
||||||
|
|
|
@ -159,12 +159,7 @@ func NewSingleHostReverseProxy(target *url.URL, without string, keepalive int) *
|
||||||
prefer(target.RawPath, target.Path),
|
prefer(target.RawPath, target.Path),
|
||||||
prefer(req.URL.RawPath, req.URL.Path))
|
prefer(req.URL.RawPath, req.URL.Path))
|
||||||
}
|
}
|
||||||
req.URL.Path = singleJoiningSlash(target.Path,
|
req.URL.Path = singleJoiningSlash(target.Path, req.URL.Path)
|
||||||
prefer(untouchedPath, req.URL.Path))
|
|
||||||
// req.URL.Path must be consistent with decoded form of req.URL.RawPath if any
|
|
||||||
if req.URL.RawPath != "" && req.URL.RawPath != req.URL.EscapedPath() {
|
|
||||||
panic("RawPath doesn't match Path")
|
|
||||||
}
|
|
||||||
|
|
||||||
// Trims the path of the socket from the URL path.
|
// Trims the path of the socket from the URL path.
|
||||||
// This is done because req.URL passed to your proxied service
|
// This is done because req.URL passed to your proxied service
|
||||||
|
|
Loading…
Reference in a new issue