Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

AWS S3 cross-origin request failed on ie9

I'm trying to make a web font and have it deployed on AWS S3.

Works fine in all browsers except IE9 where it says the cross-origin request failed when trying to load the woff file.

I've read lots and lots over many forums about people having the issue, but I've not been able to find a fix.

I think it's something to do with the CORS setup on S3 not sending the correct data or something to IE9?

(works in Firefox, Chrome, IE7,8, etc)

The only suggestions I've seen to fix the problem are, spinning up an EC2 instance and making a web host for the fonts (complete overkill!) and the other one was naming the css file as .php and setting headers in php (but this is daft).

Anyone know how (if at all possible) to fix this issue?

Thanks

Edit

My CORS config:

<?xml version="1.0" encoding="UTF-8"?>
<CORSConfiguration xmlns="http://s3.amazonaws.com/doc/2006-03-01/">
    <CORSRule>
        <AllowedOrigin>*</AllowedOrigin>
        <AllowedMethod>GET</AllowedMethod>
        <AllowedHeader>*</AllowedHeader>
    </CORSRule>
</CORSConfiguration>
like image 918
TheStoneFox Avatar asked May 13 '13 09:05

TheStoneFox


1 Answers

I've just done it. Basically, you can follow the steps to edit your S3 bucket permissions. If you need any further help, leave a comment bellow.

1) Sign in to the AWS Management Console and open the Amazon S3 console at https://console.aws.amazon.com/s3/

2) In the Buckets list, open the bucket whose properties you want to view and click "add CORS configuration"

amazon-screen-shot

3) Write the rules you are willing to add in between the tags <CORSConfiguration>

<CORSConfiguration>
  <CORSRule>
    <AllowedOrigin>*</AllowedOrigin>
    <AllowedMethod>GET</AllowedMethod>
  </CORSRule>
</CORSConfiguration>

You can learn more about rules at: http://docs.aws.amazon.com/AmazonS3/latest/dev/cors.html

like image 71
Flavio Wuensche Avatar answered Nov 05 '22 05:11

Flavio Wuensche