dyerc / craft-flux

Craft CMS plugin which integrates with AWS Lambda and CloudFront to process, cache and serve images
https://cdyer.co.uk/plugins/flux
Other
4 stars 2 forks source link

Address malformed deleteObject request #7

Closed markdrzy closed 1 year ago

markdrzy commented 1 year ago

If an empty Objects array is sent in a deleteObjects request, AWS will respond with a malformed request error. This update verifies that the number of asset paths to delete is non-zero before proceeding with the deleteObjects request; if there are no paths to delete, a warning is logged.

Fixes #6

dyerc commented 1 year ago

Thank you for spotting and fixing this! @markdrzy

I wonder if it might be better that Craft logs an info level log message. Just thinking it through now, it could well be a perfectly normal occurrence for no transformed versions to exist in S3. What do you think?

markdrzy commented 1 year ago

@dyerc I agree, nothing to purge could be a pretty normal occurrence. I'll admit that I gave the message placement very little thought — I just wanted to see something in my logs. :-)

Thanks again for the plugin!