New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
When using Proxying with the ResponseTemplateTransformer the setting proxyUrlPrefixToRemove is ignored #1783
Comments
I'm facing the same problem, when I try to use this proxy feature. A fix would be great. |
Same problem. Tryed to create a mock with a mock/intercept pattern.
} Result: Request was not matched /smartMock should route to /original, but /smartMock didnt cut! Tryed different variants, nothing works for me.
request didnt work at all! Only proxyBaseUrl with end "/" is working. |
hi - any idea which release (and associated docker container update) this is fix scheduled for? FYI, documentation refers to this feature so newbies (like me) can get confused when it doesn't work as described :) |
Still reproduces in version 2.33.2 with option |
hi @sergey-karazhenets awesome news and thanks for the effort! Just to be clear, this means when we use The reason for asking is I'm experiencing the same issue and some other flaky behaviour but wanted to test my muppetry thoroughly before I give more feedback on the issue. Thanks for the answer in advance! |
Note to future readers: here is a pair of working examples, assuming you've ran wiremock with {
"priority": 2,
"request": {
"urlPattern": "/.*",
"headers": {
"X-WM-PROXY-TARGET": {
"matches": ".*"
}
}
},
"response": {
"proxyBaseUrl": "https://{{request.headers.X-WM-PROXY-TARGET}}.example.com",
"transformers": ["response-template"],
"additionalProxyRequestHeaders": {
"cf-access-token": "{{systemValue type='ENVIRONMENT' key='CF_OPS_TOKEN'}}"
}
}
} And then you can do a self-redirect like so: {
"priority": 1,
"request": {
"urlPattern": "/my-prefix/.*",
"headers": {
"X-WM-PROXY-TARGET": {
"absent": true
}
}
},
"response": {
"proxyBaseUrl": "http://localhost:8080",
"proxyUrlPrefixToRemove": "/my-prefix",
"additionalProxyRequestHeaders": {
"X-WM-PROXY-TARGET": "my-target"
}
}
} I hope this helps! 🙂 |
Fixed in 9aad878 |
Fixed in 9aad878 |
WireMock version: 2.32.0
How to reproduce:
Use the following mapping:
Use the setting "--global-response-templating".
When sending a request to '/proxy-test/foo'
Expected behaviour: a proxy request to https://localhost:8099/foo
Actual behaviour: a proxy request to https://localhost:8099/proxy-test/foo
The text was updated successfully, but these errors were encountered: