1
0
mirror of https://github.com/fafhrd91/actix-web synced 2025-06-25 22:49:21 +02:00

propogate app config with http request; add tests for url_for

This commit is contained in:
Nikolay Kim
2019-03-09 14:06:24 -08:00
parent c0ce7f0bae
commit 54678308d0
18 changed files with 397 additions and 215 deletions

View File

@ -255,12 +255,13 @@ impl CookieSession {
}
}
impl<S, P, B: 'static> Transform<S, ServiceRequest<P>> for CookieSession
impl<S, P, B: 'static> Transform<S> for CookieSession
where
S: Service<ServiceRequest<P>, Response = ServiceResponse<B>>,
S: Service<Request = ServiceRequest<P>, Response = ServiceResponse<B>>,
S::Future: 'static,
S::Error: 'static,
{
type Request = ServiceRequest<P>;
type Response = ServiceResponse<B>;
type Error = S::Error;
type InitError = ();
@ -281,12 +282,13 @@ pub struct CookieSessionMiddleware<S> {
inner: Rc<CookieSessionInner>,
}
impl<S, P, B: 'static> Service<ServiceRequest<P>> for CookieSessionMiddleware<S>
impl<S, P, B: 'static> Service for CookieSessionMiddleware<S>
where
S: Service<ServiceRequest<P>, Response = ServiceResponse<B>>,
S: Service<Request = ServiceRequest<P>, Response = ServiceResponse<B>>,
S::Future: 'static,
S::Error: 'static,
{
type Request = ServiceRequest<P>;
type Response = ServiceResponse<B>;
type Error = S::Error;
type Future = Box<Future<Item = Self::Response, Error = Self::Error>>;