You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
Trying to map response headers while reverse proxying replaces every occurrence of TargetPath with ListenPath instead of just first one. We need redirects (Location response header) to map correctly from "/some/path" to "/foo/bar/some/path".
Reproduction steps
Steps to reproduce the behavior:
Set up reverse proxy for some content using redirects
Set TargetPath to "/"
Set ListenPath to "/foo/bar/"
Check "Strip the listen path"
Actual behavior
For example in our case TargetPath is "/" and ListenPath is "/foo/bar/" and the Location header gets mapped from "/some/path" to "/foo/bar/some/foo/bar/path".
Expected behavior
We'd expect the Location header be mapped from "/some/path" to "/foo/bar/some/path". I'd guess that the last "-1" argument in these lines (probably also other near-by similar lines) should be "1" instead, unless of course this is for some reason intentional?
Branch/Environment/Version
Describe the bug
Trying to map response headers while reverse proxying replaces every occurrence of TargetPath with ListenPath instead of just first one. We need redirects (Location response header) to map correctly from "/some/path" to "/foo/bar/some/path".
Reproduction steps
Steps to reproduce the behavior:
Actual behavior
For example in our case TargetPath is "/" and ListenPath is "/foo/bar/" and the Location header gets mapped from "/some/path" to "/foo/bar/some/foo/bar/path".
Expected behavior
We'd expect the Location header be mapped from "/some/path" to "/foo/bar/some/path". I'd guess that the last "-1" argument in these lines (probably also other near-by similar lines) should be "1" instead, unless of course this is for some reason intentional?
tyk/gateway/res_handler_header_transform.go
Lines 68 to 69 in 3f8d94d
The text was updated successfully, but these errors were encountered: