mirror of
https://github.com/matrix-org/dendrite.git
synced 2025-12-08 23:43:11 -06:00
Fix the client API proxy to handle '#' correctly
This commit is contained in:
parent
7f852e3786
commit
9858f4403d
|
|
@ -76,7 +76,11 @@ func makeProxy(targetURL string) (*httputil.ReverseProxy, error) {
|
||||||
"url": targetURL,
|
"url": targetURL,
|
||||||
"method": req.Method,
|
"method": req.Method,
|
||||||
}).Print("proxying request")
|
}).Print("proxying request")
|
||||||
newURL, err := url.Parse(targetURL + path)
|
newURL, err := url.Parse(targetURL)
|
||||||
|
// Set the path separately as we need to preserve '#' characters
|
||||||
|
// that would otherwise be interpreted as being the start of a URL
|
||||||
|
// fragment.
|
||||||
|
newURL.Path += path
|
||||||
if err != nil {
|
if err != nil {
|
||||||
// We already checked that we can parse the URL
|
// We already checked that we can parse the URL
|
||||||
// So this shouldn't ever get hit.
|
// So this shouldn't ever get hit.
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue