https://linen.dev logo
#general
Title
# general
a

AR

03/05/2023, 8:11 AM
Hi, if I have a stub that has the following request url pattern: "^/test/(AB|CD|EF)$", and in the response I have proxyUrlPrefixToRemove: {{request.url}} why does this not work? Basically all I want it to do is, remove the prefix: /test/AB or /test/CD or /test/EF according to the matched request url. I also tried setting proxyURlPrefixToRemove to: /test/{{request.pathSegments[1]}} and that did not work either. Do I need a custom transformer for this or does Wiremock support this? can someone please help me with a solution to this problem? Thanks!
t

Tom

03/05/2023, 8:37 AM
Hi @AR yes, you'd need a custom transformer to achieve this as the proxyUrlPrefixToRemove field isn't resolved as a template.
a

AR

03/05/2023, 10:40 PM
Thanks @Tom! Is this a feature enhancement that can be added?
t

Tom

03/06/2023, 11:55 AM
Yes, happy to accept a PR for this if you want to create one
5 Views