1
0
mirror of https://github.com/pocketbase/pocketbase.git synced 2024-11-28 10:03:42 +02:00

[#1343] fixed s3 file upload error caused by underscore in metadata

This commit is contained in:
Yuxiang Gao 2022-12-22 21:39:45 +08:00 committed by GitHub
parent cea287a2c1
commit ede7804a80
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 4 deletions

View File

@ -142,7 +142,7 @@ func (s *System) UploadFile(file *File, fileKey string) error {
opts := &blob.WriterOptions{
ContentType: mt.String(),
Metadata: map[string]string{
"original_filename": originalName,
"original-filename": originalName,
},
}
@ -184,7 +184,7 @@ func (s *System) UploadMultipart(fh *multipart.FileHeader, fileKey string) error
opts := &blob.WriterOptions{
ContentType: mt.String(),
Metadata: map[string]string{
"original_filename": originalName,
"original-filename": originalName,
},
}

View File

@ -177,8 +177,8 @@ func TestFileSystemUploadMultipart(t *testing.T) {
if err != nil {
t.Fatalf("Failed to fetch file attributes: %v", err)
}
if name, ok := attrs.Metadata["original_filename"]; !ok || name != "test" {
t.Fatalf("Expected original_filename to be %q, got %q", "test", name)
if name, ok := attrs.Metadata["original-filename"]; !ok || name != "test" {
t.Fatalf("Expected original-filename to be %q, got %q", "test", name)
}
}