Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 6 additions & 12 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions actix-web/CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
## Unreleased

- Minimum supported Rust version (MSRV) is now 1.82.
- Upgrade cookie dependency 0.16 to 0.18

## 4.12.1

Expand Down
2 changes: 1 addition & 1 deletion actix-web/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ actix-web-codegen = { version = "4.3", optional = true, default-features = false
bytes = "1"
bytestring = "1"
cfg-if = "1"
cookie = { version = "0.16", features = ["percent-encode"], optional = true }
cookie = { version = "0.18", features = ["percent-encode"], optional = true }
derive_more = { version = "2", features = ["as_ref", "deref", "deref_mut", "display", "error", "from"] }
encoding_rs = "0.8"
foldhash = "0.1"
Expand Down
8 changes: 4 additions & 4 deletions actix-web/src/response/builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -228,12 +228,12 @@ impl HttpResponseBuilder {
///
/// let res = HttpResponse::Ok()
/// .cookie(
/// Cookie::build("name", "value")
/// Cookie::build(("name", "value"))
/// .domain("www.rust-lang.org")
/// .path("/")
/// .secure(true)
/// .http_only(true)
/// .finish(),
/// .build(),
/// )
/// .finish();
/// ```
Expand All @@ -243,10 +243,10 @@ impl HttpResponseBuilder {
/// use actix_web::{HttpResponse, cookie::Cookie};
///
/// // the name, domain and path match the cookie created in the previous example
/// let mut cookie = Cookie::build("name", "value-does-not-matter")
/// let mut cookie = Cookie::build(("name", "value-does-not-matter"))
/// .domain("www.rust-lang.org")
/// .path("/")
/// .finish();
/// .build();
/// cookie.make_removal();
///
/// let res = HttpResponse::Ok()
Expand Down
8 changes: 4 additions & 4 deletions actix-web/tests/test_server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -745,9 +745,9 @@ async fn test_server_cookies() {
App::new().default_service(web::to(|| async {
HttpResponse::Ok()
.cookie(
Cookie::build("first", "first_value")
Cookie::build(("first", "first_value"))
.http_only(true)
.finish(),
.build(),
)
.cookie(Cookie::new("second", "first_value"))
.cookie(Cookie::new("second", "second_value"))
Expand All @@ -760,9 +760,9 @@ async fn test_server_cookies() {
assert!(res.status().is_success());

{
let first_cookie = Cookie::build("first", "first_value")
let first_cookie = Cookie::build(("first", "first_value"))
.http_only(true)
.finish();
.build();
let second_cookie = Cookie::new("second", "first_value");

let cookies = res.cookies().expect("To have cookies");
Expand Down
1 change: 1 addition & 0 deletions awc/CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
## Unreleased

- Minimum supported Rust version (MSRV) is now 1.82.
- Upgrade cookie dependency 0.16 to 0.18

## 3.8.1

Expand Down
2 changes: 1 addition & 1 deletion awc/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ serde_json = "1.0"
serde_urlencoded = "0.7"
tokio = { version = "1.38.2", features = ["sync"] }

cookie = { version = "0.16", features = ["percent-encode"], optional = true }
cookie = { version = "0.18", features = ["percent-encode"], optional = true }

tls-openssl = { package = "openssl", version = "0.10.55", optional = true }
tls-rustls-0_20 = { package = "rustls", version = "0.20", optional = true, features = ["dangerous_configuration"] }
Expand Down
2 changes: 1 addition & 1 deletion awc/src/test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ mod tests {
let res = TestResponse::default()
.version(Version::HTTP_2)
.insert_header((header::DATE, HttpDate::from(SystemTime::now())))
.cookie(cookie::Cookie::build("name", "value").finish())
.cookie(cookie::Cookie::build(("name", "value")).build())
.finish();
assert!(res.headers().contains_key(header::SET_COOKIE));
assert!(res.headers().contains_key(header::DATE));
Expand Down
2 changes: 1 addition & 1 deletion awc/src/ws.rs
Original file line number Diff line number Diff line change
Expand Up @@ -543,7 +543,7 @@ mod tests {
.protocols(["v1", "v2"])
.set_header_if_none(header::CONTENT_TYPE, "json")
.set_header_if_none(header::CONTENT_TYPE, "text")
.cookie(Cookie::build("cookie1", "value1").finish());
.cookie(Cookie::build(("cookie1", "value1")).build());
assert_eq!(
req.origin.as_ref().unwrap().to_str().unwrap(),
"test-origin"
Expand Down
6 changes: 3 additions & 3 deletions awc/tests/test_client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -667,13 +667,13 @@ async fn body_streaming_implicit() {
async fn client_cookie_handling() {
use std::io::{Error as IoError, ErrorKind};

let cookie1 = Cookie::build("cookie1", "value1").finish();
let cookie2 = Cookie::build("cookie2", "value2")
let cookie1 = Cookie::build(("cookie1", "value1")).build();
let cookie2 = Cookie::build(("cookie2", "value2"))
.domain("www.example.org")
.path("/")
.secure(true)
.http_only(true)
.finish();
.build();
// Q: are all these clones really necessary? A: Yes, possibly
let cookie1b = cookie1.clone();
let cookie2b = cookie2.clone();
Expand Down
Loading