pass HTTP metadata in S3/R2 Source impls

This commit is contained in:
Brandon Liu
2022-11-22 14:43:15 +08:00
parent a619aa84e2
commit f457724da1
3 changed files with 15 additions and 3 deletions

View File

@@ -109,7 +109,12 @@ class R2Source implements Source {
}
const o = resp as R2ObjectBody;
const a = await o.arrayBuffer();
return { data: a, etag: o.etag };
return {
data: a,
etag: o.etag,
cacheControl: o.httpMetadata?.cacheControl,
expires: o.httpMetadata?.cacheExpiry?.toISOString(),
};
}
}