Allow image lambda to fetch remote images
sladg opened this issue · comments
Consider following scenario:
- URL for images is stored in database,
- backend is using private S3 bucket to store data,
- when request is made, backend signs image URL,
- frontend displays image url (ERROR 500 currently).
next.config.js
allows us to specify domains allowed.
Image lambda should check if URL is absolute or relative. If relative, use internal S3 bucket, if absolute, fetch remote image.
As of version v4 handler can be used to fetch and optimise any image.
Remote images as well as single S3 bucket origin are supported.