Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update cookie to 0.18, use cloned() method #737

Merged
merged 1 commit into from
Jan 28, 2024
Merged
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
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
Loading