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

Wildcard matching in the middle of the path #39

Open
Bromles opened this issue Aug 8, 2023 · 3 comments
Open

Wildcard matching in the middle of the path #39

Bromles opened this issue Aug 8, 2023 · 3 comments
Labels
feature New feature or request

Comments

@Bromles
Copy link

Bromles commented Aug 8, 2023

As discussed in Tokio's Discord server, it would be useful to add support for wildcard matching in the middle of the path

For instance, this is required to implement Docker Registry API V2
Some examples are provided below:
/v2/<name>/
/v2/<name>/blobs/<digest>
/v2/<name>/manifests/<reference>
Note: <name> can contain any number of segments (at least 2), but is limited to 256 characters in length (including slashes)

Also, it can be useful for various git clients (something like /:repo/*filepath/action)

@Bromles Bromles changed the title Wildcard matching in the middle of path Wildcard matching in the middle of the path Aug 8, 2023
@ibraheemdev ibraheemdev added the feature New feature or request label Nov 2, 2023
@AzHicham
Copy link

AzHicham commented Dec 2, 2023

Hello,
Is this something still in discussion ?
In my case we plan to migrate to Axum, right now we are using Actix.
But this feature is mandatory for us in order to handle this case :

#[must_use]
pub fn imgsrv_scope<T: ServeSlide + 'static>() -> Scope {
    web::scope("/imgsrv")
        .route("{path:.+}/size", web::get().to(slide_size::<T>))
        .route("{path:.+}/roi", web::get().to(roi::<T>))
        .route("{path:.+}/slide", web::get().to(slide_info::<T>))
        .route("{path:.+}/tile", web::get().to(tile::<T>))
        .route("{path:.+}/thumbnail", web::get().to(thumbnail::<T>))
        .route("{path:.+}/is_compatible", web::get().to(is_compatible::<T>))
}

Thank you :)

@ibraheemdev
Copy link
Owner

This should be easier to implement after the 0.8 syntax change and I think can be done without hurting performance in existing patterns.

@ibraheemdev
Copy link
Owner

Now that 0.8 is release, I'll try to implement this along with #17. The implementation should be very similar.

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

No branches or pull requests

3 participants