Skip to content

Instantly share code, notes, and snippets.

@derwiki
Created February 15, 2017 23:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save derwiki/adeb5ed1018dc0a7fdd586ffed8bf998 to your computer and use it in GitHub Desktop.
Save derwiki/adeb5ed1018dc0a7fdd586ffed8bf998 to your computer and use it in GitHub Desktop.
Sample Cross-Origin Resource Sharing (CORS) Policy to allow PDF.js to read PDFs from an AWS S3 bucket.
<?xml version="1.0" encoding="UTF-8"?>
<CORSConfiguration xmlns="http://s3.amazonaws.com/doc/2006-03-01">
<CORSRule>
<AllowedOrigin>*</AllowedOrigin>
<AllowedMethod>GET</AllowedMethod>
<AllowedMethod>HEAD</AllowedMethod>
<MaxAgeSeconds>3000</MaxAgeSeconds>
<AllowedHeader>Range</AllowedHeader>
<AllowedHeader>Authorization</AllowedHeader>
<ExposeHeader>Accept-Ranges</ExposeHeader>
<ExposeHeader>Content-Encoding</ExposeHeader>
<ExposeHeader>Content-Length</ExposeHeader>
<ExposeHeader>Content-Range</ExposeHeader>
</CORSRule>
</CORSConfiguration>
@blajoie
Copy link

blajoie commented Dec 12, 2018

Good stuff - came from igv.js with the same issue. Working now, thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment