mirror of https://github.com/fafhrd91/actix-web
remove ring dependency
This commit is contained in:
parent
7946fa7faa
commit
630122cceb
|
@ -5,6 +5,7 @@
|
||||||
### Changed
|
### Changed
|
||||||
|
|
||||||
* Fix actix_http::h1::dispatcher so it returns when HW_BUFFER_SIZE is reached. Should reduce peak memory consumption during large uploads. [#1550]
|
* Fix actix_http::h1::dispatcher so it returns when HW_BUFFER_SIZE is reached. Should reduce peak memory consumption during large uploads. [#1550]
|
||||||
|
* Migrate cookie handling to `cookie` crate. Actix-web no longer requires `ring` dependency.
|
||||||
|
|
||||||
## [3.0.0-alpha.3] - 2020-05-21
|
## [3.0.0-alpha.3] - 2020-05-21
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,11 @@
|
||||||
# Changes
|
# Changes
|
||||||
|
|
||||||
|
## [Unreleased]
|
||||||
|
|
||||||
|
### Changed
|
||||||
|
|
||||||
|
* Migrate cookie handling to `cookie` crate.
|
||||||
|
|
||||||
## [2.0.0-alpha.4] - 2020-05-21
|
## [2.0.0-alpha.4] - 2020-05-21
|
||||||
|
|
||||||
### Changed
|
### Changed
|
||||||
|
|
|
@ -70,7 +70,7 @@ lazy_static = "1.4"
|
||||||
language-tags = "0.2"
|
language-tags = "0.2"
|
||||||
log = "0.4"
|
log = "0.4"
|
||||||
mime = "0.3"
|
mime = "0.3"
|
||||||
percent-encoding = "2.1" # TODO: remove
|
percent-encoding = "2.1"
|
||||||
pin-project = "0.4.17"
|
pin-project = "0.4.17"
|
||||||
rand = "0.7"
|
rand = "0.7"
|
||||||
regex = "1.3"
|
regex = "1.3"
|
||||||
|
@ -81,9 +81,6 @@ slab = "0.4"
|
||||||
serde_urlencoded = "0.6.1"
|
serde_urlencoded = "0.6.1"
|
||||||
time = { version = "0.2.7", default-features = false, features = ["std"] }
|
time = { version = "0.2.7", default-features = false, features = ["std"] }
|
||||||
|
|
||||||
# for secure cookie
|
|
||||||
ring = { version = "0.16.9", optional = true } # TODO: remove
|
|
||||||
|
|
||||||
# compression
|
# compression
|
||||||
brotli2 = { version="0.3.2", optional = true }
|
brotli2 = { version="0.3.2", optional = true }
|
||||||
flate2 = { version = "1.0.13", optional = true }
|
flate2 = { version = "1.0.13", optional = true }
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
//! Test Various helpers for Actix applications to use during testing.
|
//! Test Various helpers for Actix applications to use during testing.
|
||||||
use std::convert::TryFrom;
|
use std::convert::TryFrom;
|
||||||
use std::fmt::Write as FmtWrite;
|
|
||||||
use std::io::{self, Read, Write};
|
use std::io::{self, Read, Write};
|
||||||
use std::pin::Pin;
|
use std::pin::Pin;
|
||||||
use std::str::FromStr;
|
use std::str::FromStr;
|
||||||
|
@ -162,17 +161,17 @@ impl TestRequest {
|
||||||
head.version = inner.version;
|
head.version = inner.version;
|
||||||
head.headers = inner.headers;
|
head.headers = inner.headers;
|
||||||
|
|
||||||
let mut cookie = String::new();
|
let cookie: String = inner
|
||||||
for c in inner.cookies.delta() {
|
.cookies
|
||||||
|
.delta()
|
||||||
// ensure only name=value is written to cookie header
|
// ensure only name=value is written to cookie header
|
||||||
let c = Cookie::new(c.name(), c.value());
|
.map(|c| Cookie::new(c.name(), c.value()).encoded().to_string())
|
||||||
let _ = write!(&mut cookie, "; {}", c.encoded());
|
.collect::<Vec<_>>()
|
||||||
}
|
.join("; ");
|
||||||
|
|
||||||
if !cookie.is_empty() {
|
if !cookie.is_empty() {
|
||||||
head.headers.insert(
|
head.headers
|
||||||
header::COOKIE,
|
.insert(header::COOKIE, HeaderValue::from_str(&cookie).unwrap());
|
||||||
HeaderValue::from_str(&cookie.as_str()[2..]).unwrap(),
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
req
|
req
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
use std::convert::TryFrom;
|
use std::convert::TryFrom;
|
||||||
use std::fmt::Write as FmtWrite;
|
|
||||||
use std::rc::Rc;
|
use std::rc::Rc;
|
||||||
use std::time::Duration;
|
use std::time::Duration;
|
||||||
use std::{fmt, net};
|
use std::{fmt, net};
|
||||||
|
@ -526,16 +525,18 @@ impl ClientRequest {
|
||||||
|
|
||||||
// set cookies
|
// set cookies
|
||||||
if let Some(ref mut jar) = self.cookies {
|
if let Some(ref mut jar) = self.cookies {
|
||||||
let mut cookie = String::new();
|
let cookie: String = jar
|
||||||
for c in jar.delta() {
|
.delta()
|
||||||
// ensure only name=value is written to cookie header
|
// ensure only name=value is written to cookie header
|
||||||
let c = Cookie::new(c.name(), c.value());
|
.map(|c| Cookie::new(c.name(), c.value()).encoded().to_string())
|
||||||
let _ = write!(&mut cookie, "; {}", c.encoded());
|
.collect::<Vec<_>>()
|
||||||
|
.join("; ");
|
||||||
|
|
||||||
|
if !cookie.is_empty() {
|
||||||
|
self.head
|
||||||
|
.headers
|
||||||
|
.insert(header::COOKIE, HeaderValue::from_str(&cookie).unwrap());
|
||||||
}
|
}
|
||||||
self.head.headers.insert(
|
|
||||||
header::COOKIE,
|
|
||||||
HeaderValue::from_str(&cookie.as_str()[2..]).unwrap(),
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
let mut slf = self;
|
let mut slf = self;
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
//! Test helpers for actix http client to use during testing.
|
//! Test helpers for actix http client to use during testing.
|
||||||
use std::convert::TryFrom;
|
use std::convert::TryFrom;
|
||||||
use std::fmt::Write as FmtWrite;
|
|
||||||
|
|
||||||
use actix_http::cookie::{Cookie, CookieJar};
|
use actix_http::cookie::{Cookie, CookieJar};
|
||||||
use actix_http::http::header::{self, Header, HeaderValue, IntoHeaderValue};
|
use actix_http::http::header::{self, Header, HeaderValue, IntoHeaderValue};
|
||||||
|
@ -87,15 +86,10 @@ impl TestResponse {
|
||||||
pub fn finish(self) -> ClientResponse {
|
pub fn finish(self) -> ClientResponse {
|
||||||
let mut head = self.head;
|
let mut head = self.head;
|
||||||
|
|
||||||
let mut cookie = String::new();
|
for cookie in self.cookies.delta() {
|
||||||
for c in self.cookies.delta() {
|
|
||||||
let c = Cookie::new(c.name(), c.value());
|
|
||||||
let _ = write!(&mut cookie, "; {}", c.encoded());
|
|
||||||
}
|
|
||||||
if !cookie.is_empty() {
|
|
||||||
head.headers.insert(
|
head.headers.insert(
|
||||||
header::SET_COOKIE,
|
header::SET_COOKIE,
|
||||||
HeaderValue::from_str(&cookie.as_str()[2..]).unwrap(),
|
HeaderValue::from_str(&cookie.encoded().to_string()).unwrap(),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
//! Websockets client
|
//! Websockets client
|
||||||
use std::convert::TryFrom;
|
use std::convert::TryFrom;
|
||||||
use std::fmt::Write as FmtWrite;
|
|
||||||
use std::net::SocketAddr;
|
use std::net::SocketAddr;
|
||||||
use std::rc::Rc;
|
use std::rc::Rc;
|
||||||
use std::{fmt, str};
|
use std::{fmt, str};
|
||||||
|
@ -244,16 +243,18 @@ impl WebsocketsRequest {
|
||||||
|
|
||||||
// set cookies
|
// set cookies
|
||||||
if let Some(ref mut jar) = self.cookies {
|
if let Some(ref mut jar) = self.cookies {
|
||||||
let mut cookie = String::new();
|
let cookie: String = jar
|
||||||
for c in jar.delta() {
|
.delta()
|
||||||
// ensure only name=value is written to cookie header
|
// ensure only name=value is written to cookie header
|
||||||
let c = Cookie::new(c.name(), c.value());
|
.map(|c| Cookie::new(c.name(), c.value()).encoded().to_string())
|
||||||
let _ = write!(&mut cookie, "; {}", c.encoded());
|
.collect::<Vec<_>>()
|
||||||
|
.join("; ");
|
||||||
|
|
||||||
|
if !cookie.is_empty() {
|
||||||
|
self.head
|
||||||
|
.headers
|
||||||
|
.insert(header::COOKIE, HeaderValue::from_str(&cookie).unwrap());
|
||||||
}
|
}
|
||||||
self.head.headers.insert(
|
|
||||||
header::COOKIE,
|
|
||||||
HeaderValue::from_str(&cookie.as_str()[2..]).unwrap(),
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// origin
|
// origin
|
||||||
|
|
Loading…
Reference in New Issue