This commit is contained in:
Mateusz Gruszczyński committed 2026-11-20 23:14:19 +01:00
1 parent d455028de3
commit 5b2eaaff61
36 files changed
+2544 -102

No files matched your search

+13 -1
View File
@@ -112,6 +112,15 @@ if handshake.as_ref().is_some_and(|handshake| {
"RustProxy: HTTP/1.1 WebSocket upstream returned 2xx without switching protocols\n",
);
}
// Shared-static guard runs on the *original* backend headers, before VCL
// response edits such as strip_set_cookie or ignore_cache_control.
let shared_static_reason = if shared_static_cookie_fill && cache_ticket.is_some() {
crate::cache::shared_static_response_reason(
response.status(), response.headers(), cache_settings,
)
} else {
None
};
let cache_rule_overrides = cache_rule_context
.as_ref()
.map(|rules| rules.response_overrides(response.status(), response.headers()))
@@ -137,6 +146,7 @@ crate::cache::normalize_static_cookie_vary(
upstream_started.elapsed(), ignore_static_cookie, &cache_rule_overrides,
);
let origin_plan = if cache_ticket.is_some()
&& shared_static_reason.is_none()
&& !(ignore_static_cookie && crate::cache::varies_on(response.headers(), "cookie"))
{
crate::cache::plan_with(
@@ -153,7 +163,9 @@ let origin_plan = if cache_ticket.is_some()
None
};
let origin_reason = (cache_ticket.is_some() && origin_plan.is_none()).then(|| {
if ignore_static_cookie && crate::cache::varies_on(response.headers(), "cookie") {
if let Some(reason) = shared_static_reason {
reason
} else if ignore_static_cookie && crate::cache::varies_on(response.headers(), "cookie") {
"response_vary_cookie"
} else {
crate::cache::response_reason(response.status(), response.headers(), cache_settings)