From 786ea126a20fa19e25f5e522ae780f1cbab121f9 Mon Sep 17 00:00:00 2001 From: Arsenii Baranov Date: Mon, 10 Jul 2023 06:19:52 +0500 Subject: [PATCH 1/2] Do not filter out filename for from_url requests --- internal/codec/codec.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/internal/codec/codec.go b/internal/codec/codec.go index e2fee6a..195fe37 100644 --- a/internal/codec/codec.go +++ b/internal/codec/codec.go @@ -164,8 +164,7 @@ func writeFields(w *multipart.Writer, t reflect.Type, v reflect.Value) { tf, vf := t.Field(i), v.Field(i) // file has been already written - if tf.Name == config.FileFieldName || - tf.Name == config.FilenameFieldName { + if tf.Name == config.FileFieldName { continue } From cf4c00e3f826128b65f84361b488f96f2e897ac5 Mon Sep 17 00:00:00 2001 From: Arsenii Baranov Date: Mon, 10 Jul 2023 06:39:24 +0500 Subject: [PATCH 2/2] Update uploadFromURL test --- test/upload.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/upload.go b/test/upload.go index 5376af4..bc10fd0 100644 --- a/test/upload.go +++ b/test/upload.go @@ -52,7 +52,7 @@ func uploadFromURL(t *testing.T, r *testenv.Runner) { t.Error(err) } } - assert.Equal(t, "photo_20190914_154427.jpg", info.OriginalFileName) + assert.Equal(t, "test_file_name", info.FileName) r.Artifacts.Files = append( r.Artifacts.Files, &file.Info{BasicFileInfo: info.BasicFileInfo}, @@ -72,7 +72,7 @@ func uploadCreateGroup(t *testing.T, r *testenv.Runner) { ctx := context.Background() var ids []string for _, r := range r.Artifacts.Files { - ids = append(ids, r.ID + "/-/resize/x10/") + ids = append(ids, r.ID+"/-/resize/x10/") } info, err := r.Upload.CreateGroup(ctx, ids) assert.Equal(t, nil, err)