actix-web icon indicating copy to clipboard operation
actix-web copied to clipboard

Add pattern syntax for optional trailing slash

Open tp971 opened this issue 1 year ago • 4 comments

I proposed this idea in https://github.com/actix/actix-web/discussions/3258#discussioncomment-8358174 to handle cases where trailing slashes are relevant. Basically, allow defining a route with a pattern like "/some/path/?" that matches both "/some/path" and "/some/path/". I also proposed to add a method to check whether the URI has a trailing slash, but that can also be done with request.uri().path().ends_with('/'), so idk whether we actually need this.

tp971 avatar Feb 05 '24 01:02 tp971

@robjtede I'd like to work on this, could you point me to the files I need to look at?

deepto98 avatar May 13 '24 16:05 deepto98

@deepto98 mostly actix-router's ResourceDef... it's very well documented but lmk here or in Discord if you have questions

robjtede avatar May 18 '24 19:05 robjtede