Wildcard matching in the middle of the path
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)
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 :)
This should be easier to implement after the 0.8 syntax change and I think can be done without hurting performance in existing patterns.
Now that 0.8 is release, I'll try to implement this along with https://github.com/ibraheemdev/matchit/issues/17. The implementation should be very similar.