You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
tailscale/ipn/ipnlocal
shayne c750186830
ipn/ipnlocal: [serve] Trim mountPoint prefix from proxy path (#7334)
This change trims the mountPoint from the request URL path before
sending the request to the reverse proxy.

Today if you mount a proxy at `/foo` and request to
`/foo/bar/baz`, we leak the `mountPoint` `/foo` as part of the request
URL's path.

This fix makes removed the `mountPoint` prefix from the path so
proxied services receive requests as if they were running at the root
(`/`) path.

This could be an issue if the app generates URLs (in HTML or otherwise)
and assumes `/path`. In this case, those URLs will 404.

With that, I still think we should trim by default and not leak the
`mountPoint` (specific to Tailscale) into whatever app is hosted.
If it causes an issue with URL generation, I'd suggest looking at configuring
an app-specific path prefix or running Caddy as a more advanced
solution.

Fixes: #6571

Signed-off-by: Shayne Sweeney <shayne@tailscale.com>
3 years ago
..
testdata ipn/ipnlocal: fix the path for writing cert files (#7203) 3 years ago
c2n.go ipn: add c2n endpoint for sockstats logs 3 years ago
cert.go ipn/ipnlocal: use atomicfile.WriteFile in certFileStore 3 years ago
cert_js.go all: update copyright and license headers 3 years ago
cert_test.go ipn/ipnlocal: fix the path for writing cert files (#7203) 3 years ago
dnsconfig_test.go all: update copyright and license headers 3 years ago
expiry.go ipn/ipnlocal: handle more edge cases in netmap expiry timer 3 years ago
expiry_test.go ipn/ipnlocal: handle more edge cases in netmap expiry timer 3 years ago
local.go ipn/ipnlocal: fix cert storage in Kubernetes 3 years ago
local_test.go all: use tstest.Replace more 3 years ago
loglines_test.go all: replace logtail.{Public,Private}ID with logid.{Public,Private}ID (#7404) 3 years ago
network-lock.go cmd/tailscale: surface node-key for locked out tailnet-lock peers 3 years ago
network-lock_test.go ipn,cmd/tailscale: implement resigning nodes on tka key removal 3 years ago
peerapi.go sockstats: refactor validation to be opt-in 3 years ago
peerapi_h2c.go all: update copyright and license headers 3 years ago
peerapi_macios_ext.go all: update copyright and license headers 3 years ago
peerapi_test.go ipn/ipnlocal: drop not required StateKey parameter 3 years ago
profiles.go ipn/ipnlocal: use presence of NodeID to identify logins 3 years ago
profiles_test.go ipn/ipnlocal: use presence of NodeID to identify logins 3 years ago
serve.go ipn/ipnlocal: [serve] Trim mountPoint prefix from proxy path (#7334) 3 years ago
serve_test.go all: update copyright and license headers 3 years ago
ssh.go all: update copyright and license headers 3 years ago
ssh_stub.go all: update copyright and license headers 3 years ago
ssh_test.go ipn/ipnlocal: drop not required StateKey parameter 3 years ago
state_test.go ipn/ipnlocal: use presence of NodeID to identify logins 3 years ago