Proxy - Remove prefix
Hi,
Is there any way where I can remove an prefix from route before proxy it?
GIVEN The following code will proxy all GET requests made to http://:/other/service/.* to http://otherservice.com/approot And proxyUrlPrefixToRemove transformation parameter is set to "/other/service" WHEN running WireMock locally a request to http://localhost:8080/other/service/doc/123 THEN it would be forwarded to http://otherservice.com/approot/doc/123
Wiremock: https://github.com/tomakehurst/wiremock/issues/745 Workaround: https://gist.github.com/pavetok/62f7f0e315fcadeeae9bfcb1f8de54ad
Hello @lillo42 ,
I think this can be added to WireMock.Net, like adding a new property
"Replace" : {
"OldValue": "/other/service",
"NewValue": ""
}
to https://github.com/WireMock-Net/WireMock.Net/blob/dc078b57ea463e2c9c7da7f6579af34000596446/src/WireMock.Net/Settings/ProxyAndRecordSettings.cs
@lillo42 Is this answer clear enough?
@StefH I have raised a pull request that aims to implement your suggestion above. https://github.com/WireMock-Net/WireMock.Net/pull/924