-
We are trying to move from proxy-kit to reverse-proxy and and working fine, But we have issue with double slashes. If the api path has double slashes like http://dev.localdev.tcpci.com/app/managepermit//extapi/system/setting, the request is rejected as 404 Not Found inside Linux Container. If I need to update/cleanup the path to remove double slash, what's the best place to do the same. Any suggestions? Thanks |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 6 replies
-
That value is coming from the client and is not an assembly mistake by the proxy, right? The fixup is a simple string replace, but deciding when to do it is interesting. From your prior post, it looks like you're using IHttpProxy directly? #736. In that case you'd want to fix the path either before calling ProxyAsync or inside the request transform callback. Here's what a request transform would look like: Here's how the request uri gets built (with some allocation improvements that just got made). You can modify the path while assembling the proxyRequest.RequestUri in your own transform. |
Beta Was this translation helpful? Give feedback.
That value is coming from the client and is not an assembly mistake by the proxy, right?
The fixup is a simple string replace, but deciding when to do it is interesting. From your prior post, it looks like you're using IHttpProxy directly? #736. In that case you'd want to fix the path either before calling ProxyAsync or inside the request transform callback. Here's what a request transform would look like:
https://github.com/microsoft/reverse-proxy/blob/cd117da030ca16d201de9d579e11155ae040d791/samples/ReverseProxy.Direct.Sample/Startup.cs#L64-L72
Here's how the request uri gets built (with some allocation improvements that just got made). You can modify the path while assembling the proxy…