Skip to content

Conversation

rvolosatovs
Copy link

@rvolosatovs rvolosatovs commented Mar 21, 2022

Add url_mut method counterpart similar to how it's done for other components, e.g. https://docs.rs/tide/latest/tide/struct.Request.html#method.session_mut
Made sure the documentation is consistent with upstream library used https://docs.rs/http-types/latest/http_types/struct.Request.html#method.url

This is useful, for example, in cases where prefix of a route can contain forward-slashes and a request is to be routed to a nested server and custom routing relying on response method needs to be implemented.

For example, if /a/b/c/_myroute and /a/_myroute should call the same route on some Server, then an outer Server implementation could add a route on *, parse the URI from the request, trim the prefix as required and pass the request with modified URI (via url_mut) to the nested Server via Server::respond

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

Successfully merging this pull request may close these issues.

1 participant