humanmade / aws-rekognition

A lightweight plugin to add keywords to WordPress image uploads via automatic feature detection. Requires S3 Uploads.
57 stars 6 forks source link

Fix supported region logic #16

Closed roborourke closed 5 years ago

roborourke commented 5 years ago

The logic around checking supported regions wasn't right unfortunately.

Actually fixes #6

I think this fixes the root of the problem by adding in compatibility with S3 uploads for the default region and comparing rekog client region to S3 region.

This relies on using S3 uploads, or at least having S3_UPLOADS_REGION defined, if we were to avoid that requirement however a more robust solution would be to check the bucket region based on the given attachment file URL but that's not 100% either. Thoughts?