URL Rewriting Path Duplication in Target

Hi,

When Rewriting URLs, the path in “Rewrite to:” field gets duplicated when a request is sent to the endpoint.

If you consider the attached screenshot, when I make a post request to myTykGwAddress/someapi/test then I am routed to targetAddress/a/b/c/a/b/c instead of just targetAddress/a/b/c.
However if I don’t add any path to the target, it works fine for that.

Do you know what may be causing this or is there a fix for this? I haven’t been able to find references to such an issue anywhere.

Thanks in advance!

Cheers,
Alican

Hi Alican,

We’ve managed to replicate this issue - it seems to be related to the number of slashes in the target URL, removing one slash part seems to work, adding one fails again…

We’ve added an issue to our tracker and will have that fixed in a future version.

M.

Hi Martin,

I’m glad you were able to replicate the issue.
Could you elaborate on this “number of slashes in the target URL, removing one slash part seems to work” and perhaps give an example?

Thank you,
Alican

Please see URL rewrite duplicates endpoint path · Issue #855 · TykTechnologies/tyk · GitHub for updates. That issue also provides an API definition that reproduces the issue.

1 Like