Closed andreialecu closed 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.
null
image
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:
.JPG
https://github.com/keystonejs-contrib/k6-contrib/blob/1be465ebc16c0369759771f5b522103323ab4765/packages/fields-s3images/src/lib/image.ts#L51-L53
There's a similar issue with files with the .jpeg extension. They will upload fine, but will return null afterwards.
.jpeg
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 theimage
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