Skip to content

Commit e77a79a

Browse files
committed
Update CORS example to use JSON
1 parent 802aeec commit e77a79a

File tree

1 file changed

+18
-13
lines changed

1 file changed

+18
-13
lines changed

README.md

Lines changed: 18 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ For detailed information on how configuration of plugins works, please refer to
6161

6262
<hr/>
6363

64-
**WARNING:** Don't share a configuration object between [ember-cli-deploy-s3-index](https://github.com/ember-cli-deploy/ember-cli-deploy-s3-index) and this plugin. The way these two plugins read their configuration has sideeffects which will unfortunately break your deploy if you share one configuration object between the two (we are already working on a fix)
64+
**WARNING:** Don't share a configuration object between [ember-cli-deploy-s3-index](https://github.com/ember-cli-deploy/ember-cli-deploy-s3-index) and this plugin. The way these two plugins read their configuration has side effects which will unfortunately break your deploy if you share one configuration object between the two.
6565

6666
<hr/>
6767

@@ -292,7 +292,7 @@ If you want the contents of the S3 bucket to be accessible to the world, the fol
292292
"Effect": "Allow",
293293
"Principal": "*",
294294
"Action": "s3:GetObject",
295-
"Resource": "arn:aws:s3:::bucket-name/*"
295+
"Resource": "arn:aws:s3:::your-s3-bucket-name/*"
296296
}
297297
]
298298
}
@@ -304,19 +304,24 @@ Replace `your-s3-bucket-name` with the name of the actual bucket you are deployi
304304

305305
To properly serve certain assets (i.e. webfonts) a basic CORS configuration is needed
306306

307-
```xml
308-
<?xml version="1.0" encoding="UTF-8"?>
309-
<CORSConfiguration xmlns="http://s3.amazonaws.com/doc/2006-03-01/">
310-
<CORSRule>
311-
<AllowedOrigin>http://www.your-site.com</AllowedOrigin>
312-
<AllowedOrigin>https://www.your-site.com</AllowedOrigin>
313-
<AllowedMethod>GET</AllowedMethod>
314-
<AllowedMethod>HEAD</AllowedMethod>
315-
</CORSRule>
316-
</CORSConfiguration>
307+
```json
308+
[
309+
{
310+
"AllowedHeaders": [],
311+
"AllowedMethods": [
312+
"GET",
313+
"HEAD"
314+
],
315+
"AllowedOrigins": [
316+
"http://www.your-site.com",
317+
"https://www.your-site.com"
318+
],
319+
"ExposeHeaders": []
320+
}
321+
]
317322
```
318323

319-
Replace **http://www.your-site.com** with your domain.
324+
Replace **www.your-site.com** with your domain.
320325

321326
Some more info: [Amazon CORS guide][7], [Stackoverflow][8]
322327

0 commit comments

Comments
 (0)