diff --git a/Cargo.toml b/Cargo.toml index 2df1cda..44d07f3 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "aralez" version = "0.94.1" -edition = "2021" +edition = "2024" license = "Apache-2.0" description = "Reverse proxy built on top of Cloudflare's Pingora" exclude = ["configs/*"] @@ -32,7 +32,6 @@ noyalib = { version = "0.0.44", features = ["compat-serde-yaml"] } rand = "0.10.2" base64 = "0.23.1" jsonwebtoken = { version = "11.1.0", default-features = false, features = ["use_pem", "rust_crypto"] } -#sha2 = { version = "0.11.0-rc.5", default-features = false } sha2 = { version = "0.11.0", default-features = false } base16ct = { version = "1.0.0", features = ["alloc"] } urlencoding = "2.1.3" diff --git a/src/core/proxyhttp.rs b/src/core/proxyhttp.rs index cd73790..33217e6 100644 --- a/src/core/proxyhttp.rs +++ b/src/core/proxyhttp.rs @@ -8,9 +8,9 @@ use arc_swap::ArcSwap; use async_trait::async_trait; use axum::body::Bytes; use log::error; +use pingora::ErrorSource::Upstream; use pingora::http::{Method, RequestHeader, ResponseHeader, StatusCode}; use pingora::prelude::*; -use pingora::ErrorSource::Upstream; use pingora_cache::cache_control::CacheControl; use pingora_cache::{CacheKey, CacheMetaDefaults, RespCacheable}; use pingora_core::listeners::ALPN; @@ -109,7 +109,7 @@ impl ProxyHttp for LB { let hostname = return_header_host_from_upstream(session, &self.ump_upst); _ctx.hostname = hostname; let mut backend_id = None; - if let Some(_) = _ctx.extraparams.sticky_sessions { + if _ctx.extraparams.sticky_sessions.is_some() { if let Some(cookies) = session.req_header().headers.get("cookie") { if let Ok(cookie_str) = cookies.to_str() { if let Some(pos) = cookie_str.find("backend_id=") { diff --git a/src/utils/fordebug.rs b/src/utils/fordebug.rs index 1774f12..2aff526 100644 --- a/src/utils/fordebug.rs +++ b/src/utils/fordebug.rs @@ -8,12 +8,13 @@ pub static DEALLOC_COUNT: AtomicUsize = AtomicUsize::new(0); pub static ALLOC_BYTES: AtomicUsize = AtomicUsize::new(0); #[allow(dead_code)] unsafe impl GlobalAlloc for CountingAllocator { + #[allow(unsafe_op_in_unsafe_fn)] unsafe fn alloc(&self, layout: Layout) -> *mut u8 { ALLOC_COUNT.fetch_add(1, Ordering::Relaxed); ALLOC_BYTES.fetch_add(layout.size(), Ordering::Relaxed); System.alloc(layout) } - + #[allow(unsafe_op_in_unsafe_fn)] unsafe fn dealloc(&self, ptr: *mut u8, layout: Layout) { DEALLOC_COUNT.fetch_add(1, Ordering::Relaxed); System.dealloc(ptr, layout)