Skip to content

Commit 889cc09

Browse files
author
LIzhifeng
committed
revert: Add back the deleted comments
1 parent b0a9601 commit 889cc09

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

src/registry/r2.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -652,13 +652,15 @@ export class R2Registry implements Registry {
652652
if (env.PUSH_COMPATIBILITY_MODE === "full") {
653653
const [stream1, stream2] = limit(stream, size).tee();
654654
const partTask = upload.uploadPart(state.parts.length + 1, stream1);
655-
655+
// We can totally disable this, however we are risking that the client sends another small chunk.
656+
// Maybe instead we can throw range error
656657
const dateInOneHour = new Date();
657658
dateInOneHour.setTime(dateInOneHour.getTime() + 60 * 60 * 1000);
658659
const headers = {
660+
// https://www.rfc-editor.org/rfc/rfc1123 date format
661+
// Objects will typically be removed from a bucket within 24 hours of the x-amz-expiration value.
659662
"x-amz-expiration": dateInOneHour.toUTCString(),
660663
} as const;
661-
662664
const r2RegistryObjectTask = env.REGISTRY.put(path, stream2, {
663665
httpMetadata: new Headers(headers),
664666
customMetadata: headers,

0 commit comments

Comments
 (0)