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

URL params (?param1=somevalue) mess up rest patterns #14

Open
PhilippGrashoff opened this issue Mar 14, 2019 · 1 comment
Open

URL params (?param1=somevalue) mess up rest patterns #14

PhilippGrashoff opened this issue Mar 14, 2019 · 1 comment

Comments

@PhilippGrashoff
Copy link
Contributor

PhilippGrashoff commented Mar 14, 2019

Hi,
when passing URL params to the api, the Api->rest() does not work as supposed. Furthermore, if the last part of the pattern is a variable (e.g. :id), the URL params are added to this variable

pattern setup: 
$this->rest('/bookings', new Booking($this->app->db));

This request is not recoqnized:
www.mydomain.com/api/bookings?access_token=123456

DELETE www.mydomain.com/api/bookings/3?access_token=123456
=> id which should be 3 becomes 3?access_token=123456

My proposal:

  • remove all URL params from $this->path and store them seperately. Tested, works for the 2 cases above.
@DarkSide666
Copy link
Member

Can you make PR please?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants