fix support for cross-domain calls to S3 and Cloudfront