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

Cross-segment regex route matching #613

Open
mzr opened this issue Apr 26, 2023 · 2 comments
Open

Cross-segment regex route matching #613

mzr opened this issue Apr 26, 2023 · 2 comments

Comments

@mzr
Copy link

mzr commented Apr 26, 2023

Hi,

I know I can have a route defined with regex like /abcd/:id:.*, however this doesn't match /abcd/a/b. Is there a way to do this in Gotham, where .* is not constrained to a single segment? I can always have a glob matcher /abcd/* and parse rest of the uri myself, but was wondering if Gotham supports something like this and I have missed it.
Ideally I'd like something like: ^/abcd/(.+)\.cgi/*

I'm pretty much extracting a path and passing it to a fCGI script down the line.

Thanks!

@mzr
Copy link
Author

mzr commented Apr 26, 2023

In nginx for example I can have a location:
location ~ '/abcd/(?<multiple_segments>.+\.cgi)(?<rest_of_the_uri>.*)

https://nginx.org/en/docs/http/ngx_http_core_module.html#location

@msrd0
Copy link
Member

msrd0 commented Apr 26, 2023

I don't think regex glob matching is currently implemented

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