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

RFC: Rework request URL (path, host, etc.) matching #252

Open
AndrewDryga opened this issue Jun 9, 2017 · 2 comments
Open

RFC: Rework request URL (path, host, etc.) matching #252

AndrewDryga opened this issue Jun 9, 2017 · 2 comments

Comments

@AndrewDryga
Copy link
Member

AndrewDryga commented Jun 9, 2017

Right now we are using PostgreSQL-style pattern matching with % and _, even trough it works, there are some limits and features that we want to support:

  1. We want to match paths /some_api and /some_api/123 as different APIs. Current workaroung is defining /some_api_ and /some_api/_% with different match_priority. It looks ugly and will match /some_api1, which will unexpected for most users.

  2. It would be really awesome to take parts of request and substitute them to upstream path. Eg: /blog/:id/comments -> /comments/:id.

  3. Regex matching is expensive.

@AndrewDryga
Copy link
Member Author

First implementation proposal is to use Plug-style matching in all routes, It's even possible to leverage existing codebase for that.

@AndrewDryga AndrewDryga changed the title Rework path and host matching RFC: Rework request URL (path, host, etc.) matching Sep 3, 2017
@AndrewDryga
Copy link
Member Author

Some useful code can be found here: https://github.com/inaka/cowboy-trails

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

No branches or pull requests

1 participant