aboutsummaryrefslogtreecommitdiffhomepage
path: root/pingora-cache/src/lib.rs
diff options
context:
space:
mode:
Diffstat (limited to 'pingora-cache/src/lib.rs')
-rw-r--r--pingora-cache/src/lib.rs7
1 files changed, 6 insertions, 1 deletions
diff --git a/pingora-cache/src/lib.rs b/pingora-cache/src/lib.rs
index 8f88299..1a97041 100644
--- a/pingora-cache/src/lib.rs
+++ b/pingora-cache/src/lib.rs
@@ -719,10 +719,15 @@ impl HttpCache {
// that requires cacheable_filter to take a mut header and just return InternalMeta
// update new meta with old meta's created time
- let created = inner.meta.as_ref().unwrap().0.internal.created;
+ let old_meta = inner.meta.take().unwrap();
+ let created = old_meta.0.internal.created;
meta.0.internal.created = created;
// meta.internal.updated was already set to new meta's `created`,
// no need to set `updated` here
+ // Merge old extensions with new ones. New exts take precedence if they conflict.
+ let mut extensions = old_meta.0.extensions;
+ extensions.extend(meta.0.extensions);
+ meta.0.extensions = extensions;
inner.meta.replace(meta);