dimanche 25 janvier 2015

Amazon S3 Cross Origin Resource Sharing Not working

I'm trying to serve font files from my Amazon S3 bucket. The font files are referred to from a fonts.css file as follow:



@font-face {
font-family: 'customFont';
src:url('fonts2/customFont.eot?6akx5h');
src:url('fonts2/customFont.eot?#iefix6akx5h') format('embedded-opentype'),
url('fonts2/customFont.woff?6akx5h') format('woff'),
url('fonts2/customFont.ttf?6akx5h') format('truetype'),
url('fonts2/customFont.svg?6akx5h#customFont') format('svg');
font-weight: normal;
font-style: normal;


}


The bucket CORS configuration is as follow:



<?xml version="1.0" encoding="UTF-8"?>
<CORSConfiguration xmlns="http://ift.tt/1f8lKAh">
<CORSRule>
<AllowedOrigin>http://ift.tt/1mSPrrD;
<AllowedMethod>GET</AllowedMethod>
<AllowedMethod>HEAD</AllowedMethod>
<AllowedMethod>POST</AllowedMethod>
<AllowedMethod>PUT</AllowedMethod>
<MaxAgeSeconds>3000</MaxAgeSeconds>
<AllowedHeader>*</AllowedHeader>
</CORSRule>


The font files reside in my Amazon S3 bucket. The Access-Control-Allow-Origin response header is always present right after the files are uploaded to the S3 bucket. However, about 13 or 14 hours later, that header (along with the rest CORS header) disappear without any intervention from my end. This causes the CORS error to appear in many browsers inclduing Chrome, FireFox and IE.


I tried serving the font files with the following URLS:



http://ift.tt/1JooVmD
http://ift.tt/1JooXLd
http://ift.tt/1uKMjYr


What could be the reason for the absent CORS headers ? Also, what could cause the headers to disappear several hours after the files are uploaded ?


p.s. if you replace mySiteName with the word afyash you will get access to the files.


Aucun commentaire:

Enregistrer un commentaire