This commit is contained in:
Mateusz Gruszczyński committed 2026-11-19 23:23:01 +01:00
1 parent 8b7f5dbfb8
commit 5e43752041
3 files changed
+9 -92

No files matched your search

+7 -22
View File
@@ -30,23 +30,14 @@ impl CachePlan {
}
pub(super) fn with_vcl_cookie_lookup(mut self, allowed: bool) -> Self {
if let Self::Enabled {
vcl_cookie_lookup, ..
} = &mut self
{
if let Self::Enabled { vcl_cookie_lookup, .. } = &mut self {
*vcl_cookie_lookup = allowed;
}
self
}
pub(super) fn vcl_cookie_lookup(self) -> bool {
matches!(
self,
Self::Enabled {
vcl_cookie_lookup: true,
..
}
)
matches!(self, Self::Enabled { vcl_cookie_lookup: true, .. })
}
pub(super) fn force_cache(self) -> bool {
@@ -83,17 +74,11 @@ impl CachePlan {
Self::Enabled {
force_cache: true, ..
} => crate::cache::forced_request_policy(method, headers, body_empty),
Self::Enabled {
vcl_cookie_lookup, ..
} => crate::cache::request_policy_with_vcl_cookie(
method,
headers,
body_empty,
path,
has_query,
settings,
vcl_cookie_lookup,
),
Self::Enabled { vcl_cookie_lookup, .. } => {
crate::cache::request_policy_with_vcl_cookie(
method, headers, body_empty, path, has_query, settings, vcl_cookie_lookup,
)
}
}
}
}