fix: properly handle x-amz-meta-updated-at

This commit is contained in:
zhom
2026-07-20 00:31:43 +04:00
parent a71dad735e
commit 8fe38453d4
2 changed files with 71 additions and 1 deletions
+10 -1
View File
@@ -329,7 +329,16 @@ export class SyncService implements OnModuleInit {
Metadata: metadata,
});
const url = await getSignedUrl(this.s3Client, command, { expiresIn });
const metadataHeaders = new Set(
Object.keys(metadata ?? {}).map((name) => `x-amz-meta-${name}`),
);
const url = await getSignedUrl(this.s3Client, command, {
expiresIn,
// The AWS presigner otherwise hoists user metadata into the query string.
// The client echoes the response metadata as headers, so those headers
// must remain in the request and be covered by SignedHeaders.
unhoistableHeaders: metadataHeaders,
});
// Report profile usage after upload presign if key is under profiles/
if (ctx.mode === "cloud" && dto.key.startsWith("profiles/")) {