Skip to content

Fix URL path duplication in Route Service ReverseProxy Summary - #2

Open
suppqt wants to merge 2 commits into
funcf:masterfrom
suppqt:master
Open

Fix URL path duplication in Route Service ReverseProxy Summary#2
suppqt wants to merge 2 commits into
funcf:masterfrom
suppqt:master

Conversation

@suppqt

@suppqt suppqt commented Jul 30, 2026

Copy link
Copy Markdown

httputil.NewSingleHostReverseProxy was appending the incoming request path (req.URL.Path) onto the path already present in the X-CF-Forwarded-Url header provided by Cloud Foundry. This resulted in duplicated request paths (e.g., /styles.css/styles.css), causing the upstream application to return a 404 status for CSS and other assets.

Changes Made
main.go: Overrode the proxy.Director function in ReverseProxy to directly assign the parsed X-CF-Forwarded-Url target (target.URL, target.Host) to the outgoing request.

Ensured path normalization so single-path asset requests are forwarded 1:1 without duplication.

suppqt added 2 commits July 30, 2026 10:26
ttputil.NewSingleHostReverseProxy was appending the incoming request path (req.URL.Path) onto the path already present in the X-CF-Forwarded-Url header provided by Cloud Foundry. This resulted in duplicated request paths (e.g., /styles.css/styles.css), causing the upstream application to return a 404 status for CSS and other assets.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant