TykTechnologies / tyk

Tyk Open Source API Gateway written in Go, supporting REST, GraphQL, TCP and gRPC protocols
Other
9.75k stars 1.09k forks source link

rewrite_to doesn't create the current outbound url #6696

Open DavidDiegoTal opened 2 weeks ago

DavidDiegoTal commented 2 weeks ago

Branch/Environment/Version

Describe the bug After upgrading to v5.6.1 the next url_rewrites doesn't work as expected: "url_rewrites": [ { "path": "/e2e/api/v1/execute/{scenario}", "method": "GET", "match_pattern": "/e2e/api/v1/execute/(.*)", "rewrite_to": "/api/v1/tests/execute/$1" }]

The actual result is (from Debug logs): time="Nov 07 12:25:05" level=debug msg="Outbound request URL: http://XXX/e2e/api/v1/execute/run_tyk_health_check" api_id=XXX api_name="E2E Execute API" mw=ReverseProxy org_id=default

it should have be rewritten to: http://XXX/api/v1/tests/execute/run_tyk_health_check. as in previous tyk version v5.1.0

Reproduction steps Upgrade tyk to v5.6.1

"url_rewrites": [ { "path": "/e2e/api/v1/execute/{scenario}", "method": "GET", "match_pattern": "/e2e/api/v1/execute/(.*)", "rewrite_to": "/api/v1/tests/execute/$1" }]

Actual behavior time="Nov 07 12:25:05" level=debug msg="Outbound request URL: http://XXX/e2e/api/v1/execute/run_tyk_health_check" api_id=XXX api_name="E2E Execute API" mw=ReverseProxy org_id=default

Expected behavior it should have be rewritten to: http://XXX/api/v1/tests/execute/run_tyk_health_check. as in previous tyk version v5.1.0

Screenshots/Video If applicable, add screenshots or video to help explain your problem.

Logs (debug mode or log file): Log from console or from log file.

Configuration (tyk config file): Attach tyk configuration file

Additional context Add any other context about the problem here.

buger commented 2 weeks ago

Hi! From which version you have upgraded? Thanks!

DavidDiegoTal commented 2 weeks ago

Upgraded from v5.1.0 to v5.6.1

DavidDiegoTal commented 2 weeks ago

We have tested also v5.4.0 and we don't get this issue. Seems that there is an issue with v5.6.1