Skip to content

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

@PhilippGrashoff

Description

@PhilippGrashoff

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions