mirror of
https://github.com/pocketbase/pocketbase.git
synced 2025-04-19 14:52:20 +02:00
[#1343] fixed s3 file upload error caused by underscore in metadata
This commit is contained in:
parent
cea287a2c1
commit
ede7804a80
@ -142,7 +142,7 @@ func (s *System) UploadFile(file *File, fileKey string) error {
|
|||||||
opts := &blob.WriterOptions{
|
opts := &blob.WriterOptions{
|
||||||
ContentType: mt.String(),
|
ContentType: mt.String(),
|
||||||
Metadata: map[string]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{
|
opts := &blob.WriterOptions{
|
||||||
ContentType: mt.String(),
|
ContentType: mt.String(),
|
||||||
Metadata: map[string]string{
|
Metadata: map[string]string{
|
||||||
"original_filename": originalName,
|
"original-filename": originalName,
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -177,8 +177,8 @@ func TestFileSystemUploadMultipart(t *testing.T) {
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
t.Fatalf("Failed to fetch file attributes: %v", err)
|
t.Fatalf("Failed to fetch file attributes: %v", err)
|
||||||
}
|
}
|
||||||
if name, ok := attrs.Metadata["original_filename"]; !ok || name != "test" {
|
if name, ok := attrs.Metadata["original-filename"]; !ok || name != "test" {
|
||||||
t.Fatalf("Expected original_filename to be %q, got %q", "test", name)
|
t.Fatalf("Expected original-filename to be %q, got %q", "test", name)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user