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:
parent
cea287a2c1
commit
ede7804a80
@ -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,
|
||||
},
|
||||
}
|
||||
|
||||
|
@ -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)
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user