mirror of
https://github.com/fafhrd91/actix-web
synced 2025-06-25 22:49:21 +02:00
fork cookie crate
This commit is contained in:
@ -108,7 +108,7 @@ pub use actix_web_codegen::*;
|
||||
|
||||
// re-export for convenience
|
||||
pub use actix_http::Response as HttpResponse;
|
||||
pub use actix_http::{http, Error, HttpMessage, ResponseError, Result};
|
||||
pub use actix_http::{cookie, http, Error, HttpMessage, ResponseError, Result};
|
||||
|
||||
pub use crate::app::App;
|
||||
pub use crate::extract::FromRequest;
|
||||
|
@ -51,11 +51,11 @@ use std::cell::RefCell;
|
||||
use std::rc::Rc;
|
||||
|
||||
use actix_service::{Service, Transform};
|
||||
use cookie::{Cookie, CookieJar, Key, SameSite};
|
||||
use futures::future::{ok, Either, FutureResult};
|
||||
use futures::{Future, IntoFuture, Poll};
|
||||
use time::Duration;
|
||||
|
||||
use crate::cookie::{Cookie, CookieJar, Key, SameSite};
|
||||
use crate::error::{Error, Result};
|
||||
use crate::http::header::{self, HeaderValue};
|
||||
use crate::request::HttpRequest;
|
||||
|
@ -18,5 +18,5 @@ mod logger;
|
||||
pub use self::defaultheaders::DefaultHeaders;
|
||||
pub use self::logger::Logger;
|
||||
|
||||
#[cfg(feature = "cookies")]
|
||||
#[cfg(feature = "secure-cookies")]
|
||||
pub mod identity;
|
||||
|
@ -263,14 +263,12 @@ mod tests {
|
||||
}
|
||||
|
||||
#[test]
|
||||
#[cfg(feature = "cookies")]
|
||||
fn test_no_request_cookies() {
|
||||
let req = TestRequest::default().to_http_request();
|
||||
assert!(req.cookies().unwrap().is_empty());
|
||||
}
|
||||
|
||||
#[test]
|
||||
#[cfg(feature = "cookies")]
|
||||
fn test_request_cookies() {
|
||||
let req = TestRequest::default()
|
||||
.header(header::COOKIE, "cookie1=value1")
|
||||
|
@ -2,6 +2,7 @@
|
||||
use std::cell::RefCell;
|
||||
use std::rc::Rc;
|
||||
|
||||
use actix_http::cookie::Cookie;
|
||||
use actix_http::http::header::{Header, HeaderName, IntoHeaderValue};
|
||||
use actix_http::http::{HttpTryFrom, Method, StatusCode, Version};
|
||||
use actix_http::test::TestRequest as HttpTestRequest;
|
||||
@ -11,8 +12,6 @@ use actix_rt::Runtime;
|
||||
use actix_server_config::ServerConfig;
|
||||
use actix_service::{FnService, IntoNewService, NewService, Service};
|
||||
use bytes::Bytes;
|
||||
#[cfg(feature = "cookies")]
|
||||
use cookie::Cookie;
|
||||
use futures::future::{lazy, Future};
|
||||
|
||||
use crate::config::{AppConfig, AppConfigInner};
|
||||
@ -285,7 +284,6 @@ impl TestRequest {
|
||||
self
|
||||
}
|
||||
|
||||
#[cfg(feature = "cookies")]
|
||||
/// Set cookie for this request
|
||||
pub fn cookie(mut self, cookie: Cookie) -> Self {
|
||||
self.req.cookie(cookie);
|
||||
|
Reference in New Issue
Block a user