I am creating a PDF that contains images that are stored on Amazon S3. My Rails application uses https, so the URL of the S3 image is https, which is configured in production.rb:
config.paperclip_defaults = {
:storage => :s3,
:s3_protocol => :https
}
The problem is that there is a security policy in the S3 bucket that only displays the image when it comes from my web domain. This works well when displaying an image in a view, because the referent is my web domain, which is white.
The problem when creating a PDF file is that it is wicked_pdftrying to get the image, but S3 does not see that it comes from my web domain and returns 403 Forbidden. So what can I do to solve this problem?
source
share