mirror of
https://github.com/kyantech/Palmr.git
synced 2025-10-23 06:11:58 +00:00
fix(server): disable automatic checksums in S3 presigned URLs for large file uploads
Co-authored-by: danielalves96 <62755605+danielalves96@users.noreply.github.com>
This commit is contained in:
@@ -80,7 +80,21 @@ export class S3StorageProvider implements StorageProvider {
|
|||||||
Key: objectName,
|
Key: objectName,
|
||||||
});
|
});
|
||||||
|
|
||||||
return await getSignedUrl(s3Client, command, { expiresIn: expires });
|
// Disable automatic checksum calculation for large file uploads
|
||||||
|
// This prevents the SDK from adding x-amz-checksum-* headers that may cause
|
||||||
|
// 400 Bad Request errors with S3-compatible providers like Wasabi for files > 10GB
|
||||||
|
// The unhoistableHeaders option prevents specific headers from being included in the presigned URL
|
||||||
|
return await getSignedUrl(s3Client, command, {
|
||||||
|
expiresIn: expires,
|
||||||
|
unhoistableHeaders: new Set([
|
||||||
|
"x-amz-checksum-crc32",
|
||||||
|
"x-amz-checksum-crc32c",
|
||||||
|
"x-amz-checksum-sha1",
|
||||||
|
"x-amz-checksum-sha256",
|
||||||
|
"x-amz-checksum-crc64nvme",
|
||||||
|
"x-amz-sdk-checksum-algorithm",
|
||||||
|
]),
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
async getPresignedGetUrl(objectName: string, expires: number, fileName?: string): Promise<string> {
|
async getPresignedGetUrl(objectName: string, expires: number, fileName?: string): Promise<string> {
|
||||||
|
Reference in New Issue
Block a user