1
0
mirror of https://github.com/fafhrd91/actix-web synced 2025-08-31 08:57:00 +02:00

remove ambiguous HttpResponseBuilder::del_cookie (#2591)

This commit is contained in:
Rob Ede
2022-01-21 17:18:07 +00:00
committed by GitHub
parent bc89f0bfc2
commit ae7f71e317
4 changed files with 59 additions and 79 deletions

View File

@@ -11,7 +11,7 @@ use std::{
};
use actix_web::{
cookie::{Cookie, CookieBuilder},
cookie::Cookie,
http::{header, StatusCode},
middleware::{Compress, NormalizePath, TrailingSlash},
web, App, Error, HttpResponse,
@@ -773,7 +773,7 @@ async fn test_server_cookies() {
App::new().default_service(web::to(|| {
HttpResponse::Ok()
.cookie(
CookieBuilder::new("first", "first_value")
Cookie::build("first", "first_value")
.http_only(true)
.finish(),
)
@@ -787,13 +787,13 @@ async fn test_server_cookies() {
let res = req.send().await.unwrap();
assert!(res.status().is_success());
let first_cookie = CookieBuilder::new("first", "first_value")
let first_cookie = Cookie::build("first", "first_value")
.http_only(true)
.finish();
let second_cookie = Cookie::new("second", "second_value");
let second_cookie = Cookie::new("second", "first_value");
let cookies = res.cookies().expect("To have cookies");
assert_eq!(cookies.len(), 2);
assert_eq!(cookies.len(), 3);
if cookies[0] == first_cookie {
assert_eq!(cookies[1], second_cookie);
} else {
@@ -809,7 +809,7 @@ async fn test_server_cookies() {
.get_all(http::header::SET_COOKIE)
.map(|header| header.to_str().expect("To str").to_string())
.collect::<Vec<_>>();
assert_eq!(cookies.len(), 2);
assert_eq!(cookies.len(), 3);
if cookies[0] == first_cookie {
assert_eq!(cookies[1], second_cookie);
} else {