keystonejs-contrib / k6-contrib

Keyston-6 contrib
MIT License
35 stars 18 forks source link

s3images issue with upper case file extensions #15

Closed andreialecu closed 3 years ago

andreialecu commented 3 years ago

I've been trying to use the s3 images field type and noticed it wasn't working properly, returning null from the graphql response for the image field.

Uploading to the bucket works fine however.

While debugging I noticed that the list of supported extensions is lowercase:

https://github.com/keystonejs-contrib/k6-contrib/blob/1c7861c6b2d8fa2d730679d3103888f3fdf851a0/packages/fields-s3images/src/lib/utils.ts#L7

The image I was testing with had an uppercase extension of .JPG. It appears that it then doesn't match this check:

https://github.com/keystonejs-contrib/k6-contrib/blob/1be465ebc16c0369759771f5b522103323ab4765/packages/fields-s3images/src/lib/image.ts#L51-L53

andreialecu commented 3 years ago

There's a similar issue with files with the .jpeg extension. They will upload fine, but will return null afterwards.