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

route parameters contained / cannot be matched #26

Closed
marswong opened this issue Sep 17, 2020 · 2 comments
Closed

route parameters contained / cannot be matched #26

marswong opened this issue Sep 17, 2020 · 2 comments

Comments

@marswong
Copy link

routeToRegexp currently use \w+ to match parameter, but parameter might contain /, especially at the senario of object storage service, we need provide a proxy for objects:

GET /dir1/dir2/dir3/file => (route) /{namespace}/{file}
@aisk
Copy link
Owner

aisk commented Sep 17, 2020

There was a plan to support route parameters with type, see #1 . And after finished this feature, I think we can add a special route parameter type, which allows contain '/'.

For now, we support writing regexp directly actually, and routeToRegexp is a helper for translate common usecasees in route, so I think you can write .+ in you route?

@marswong
Copy link
Author

There was a plan to support route parameters with type, see #1 . And after finished this feature, I think we can add a special route parameter type, which allows contain '/'.

For now, we support writing regexp directly actually, and routeToRegexp is a helper for translate common usecasees in route, so I think you can write .+ in you route?

I still need named parameters in req.Params, let's track it in the typed parameters feature :)

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

2 participants