Commit 88805564 by Roy Committed by GitHub

fix: limit s3 filename and metadata "origin-finename" max length to 50 (#6000)

parent dbcf5b00
...@@ -178,7 +178,7 @@ export class S3DatasetSource { ...@@ -178,7 +178,7 @@ export class S3DatasetSource {
await this.bucket.putObject(key, buffer, buffer.length, { await this.bucket.putObject(key, buffer, buffer.length, {
'content-type': Mimes[path.extname(truncatedFilename) as keyof typeof Mimes], 'content-type': Mimes[path.extname(truncatedFilename) as keyof typeof Mimes],
'upload-time': new Date().toISOString(), 'upload-time': new Date().toISOString(),
'origin-filename': encodeURIComponent(filename) // 保持原始文件名在元数据中 'origin-filename': encodeURIComponent(truncatedFilename)
}); });
await MongoS3TTL.create({ await MongoS3TTL.create({
minioKey: key, minioKey: key,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment