seanmonstar / warp

A super-easy, composable, web server framework for warp speeds.
https://seanmonstar.com/post/176530511587/warp
MIT License
9.61k stars 724 forks source link

Make route::with public for external #812

Open tojocky opened 3 years ago

tojocky commented 3 years ago

Is your feature request related to a problem? Please describe. I want to redirect all calls for a specific path from http to https. For this I cannot read the full uri to identify the the scheme and authority.

Describe the solution you'd like One solution is to add warp::with_uri method. another would be to make public route::with with the route class. this would be possible for different integrations into warp. Keeping route private from external crates make it hard to glue the missing gaps in warp.

Describe alternatives you've considered No alternatives.

Additional context NA

outergod commented 3 years ago

I also require access to the route in one of my handlers, but for a different use case related to #871: RFC 4918 (WebDAV) requires the inclusion of the HTTP request version from the request HTTP preamble as well as the original full URI in responses to PROPFIND requests. Right now, the route is only accessible for logging and tracing, which is useless for this use case.