Skip to content
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

strip_path strips multiple matching prefixes #442

Closed
codewaffle opened this issue Jul 31, 2015 · 1 comment
Closed

strip_path strips multiple matching prefixes #442

codewaffle opened this issue Jul 31, 2015 · 1 comment
Assignees
Labels

Comments

@codewaffle
Copy link

I've got a setup mostly like this, under Kong 0.4.1 on Debian Wheezy using a precompiled release:

path: /embed
strip_path: true
target_url: http://my_api_host.com/embed-api

I want to access the endpoint at http://my_api_host.com/embed-api/embed/[stuff] via http://kong_host.com/embed/embed/[stuff]

Kong is giving me back http://my_api_host.com/embed-api/[stuff] instead, treating both embed entries in the path as parts to be stripped instead of just the first.

@sycdan
Copy link

sycdan commented Jul 31, 2015

Can we not just limit the gsub to 1?

request_uri = string.gsub(request_uri, escaped_path, "", 1)

thibaultcha added a commit that referenced this issue Aug 11, 2015
- Prevent strip_path from matching multiple times the request_uri. Fix
  #442
- Prevent the resolver from wrongfully matching some request_uri with
  some paths.
ctranxuan pushed a commit to streamdataio/kong that referenced this issue Aug 25, 2015
- Prevent strip_path from matching multiple times the request_uri. Fix
  Kong#442
- Prevent the resolver from wrongfully matching some request_uri with
  some paths.


Former-commit-id: 4c7aef37351b2ee6ad259847eb2fde22c7d1645c
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants