Skip to content

Commit

Permalink
update cookie to 0.18, use cloned() method (poem-web#737)
Browse files Browse the repository at this point in the history
  • Loading branch information
getong authored Jan 28, 2024
1 parent 8ba7f13 commit a7b9623
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion poem/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ redis = { version = "0.24.0", optional = true, features = [
"tokio-comp",
"connection-manager",
] }
libcookie = { package = "cookie", version = "0.17", features = [
libcookie = { package = "cookie", version = "0.18", features = [
"percent-encode",
"private",
"signed",
Expand Down
2 changes: 1 addition & 1 deletion poem/src/listener/rustls.rs
Original file line number Diff line number Diff line change
Expand Up @@ -411,7 +411,7 @@ impl ResolvesServerCert for ResolveServerCert {
fn resolve(&self, client_hello: ClientHello) -> Option<Arc<CertifiedKey>> {
client_hello
.server_name()
.and_then(|name| self.certifcate_keys.get(name).map(Arc::clone))
.and_then(|name| self.certifcate_keys.get(name).cloned())
.or_else(|| self.fallback.clone())
}
}
Expand Down
6 changes: 3 additions & 3 deletions poem/src/web/cookie.rs
Original file line number Diff line number Diff line change
Expand Up @@ -364,7 +364,7 @@ impl CookieJar {
pub fn remove(&self, name: impl AsRef<str>) {
self.jar
.lock()
.remove(libcookie::Cookie::named(name.as_ref().to_string()));
.remove(libcookie::Cookie::build(name.as_ref().to_string()));
}

/// Returns a reference to the [`Cookie`] inside this jar with the `name`.
Expand Down Expand Up @@ -562,7 +562,7 @@ impl<'a> PrivateCookieJar<'a> {
pub fn remove(&self, name: impl AsRef<str>) {
let mut cookie_jar = self.cookie_jar.jar.lock();
let mut private_cookie_jar = cookie_jar.private_mut(self.key);
private_cookie_jar.remove(libcookie::Cookie::named(name.as_ref().to_string()));
private_cookie_jar.remove(libcookie::Cookie::build(name.as_ref().to_string()));
}

/// Returns cookie inside this jar with the name and authenticates and
Expand Down Expand Up @@ -595,7 +595,7 @@ impl<'a> SignedCookieJar<'a> {
pub fn remove(&self, name: impl AsRef<str>) {
let mut cookie_jar = self.cookie_jar.jar.lock();
let mut signed_cookie_jar = cookie_jar.signed_mut(self.key);
signed_cookie_jar.remove(libcookie::Cookie::named(name.as_ref().to_string()));
signed_cookie_jar.remove(libcookie::Cookie::build(name.as_ref().to_string()));
}

/// Returns cookie inside this jar with the name and authenticates and
Expand Down

0 comments on commit a7b9623

Please sign in to comment.