Skip to content

Commit

Permalink
Merge pull request #23 from genme/fix-from-url
Browse files Browse the repository at this point in the history
[LIBS-625] Fix missing filename in from_url request
  • Loading branch information
genme authored Jul 10, 2023
2 parents d856e69 + cf4c00e commit 6d70d47
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
3 changes: 1 addition & 2 deletions internal/codec/codec.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand Down
4 changes: 2 additions & 2 deletions test/upload.go
Original file line number Diff line number Diff line change
Expand Up @@ -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},
Expand All @@ -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)
Expand Down

0 comments on commit 6d70d47

Please sign in to comment.