diff --git a/src/httprequest.rs b/src/httprequest.rs index 6f3bfe13..a21d772e 100644 --- a/src/httprequest.rs +++ b/src/httprequest.rs @@ -81,6 +81,15 @@ impl HttpRequest { } } + /// Construct new http request with empty state. + pub fn drop_state(&self) -> HttpRequest { + HttpRequest { + Rc::new(()), + req: self.req.as_ref().map(|r| r.clone()), + resource: self.resource.clone(), + } + } + #[inline] /// Construct new http request with new RouteInfo. pub(crate) fn with_route_info(&self, mut resource: ResourceInfo) -> HttpRequest {