Skip to content
This repository has been archived by the owner on Feb 25, 2018. It is now read-only.

Commit

Permalink
Fix CORS statement in README.
Browse files Browse the repository at this point in the history
This fixes #25.

This also removes the ext. stylesheet from
the parse large css test as it’s not related
to the test case.
  • Loading branch information
anselmh committed Feb 24, 2015
1 parent 5e44b8c commit d8132d9
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
12 changes: 11 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,17 @@ For example you need to set the header to:

'Access-Control-Allow-Origin: *'

and then add this attribute `crossorigin="use-credentials"` to your CSS `link` element. This should fix [the issue](https://github.com/anselmh/object-fit/issues/7).
This should fix [the issue](https://github.com/anselmh/object-fit/issues/7). If you also need to support credentials, [you can’t use `*`](#25) but need the server reply with two headers (server needs also to reply with `Access-Control-Allow-Credentials: true`), one of which includes the origin in question.

In case you can’t alter the CSP / CORS settings of the server in question, you can disable parsing external CSS files in the config of the call:

<script>
objectFit.polyfill({
selector: 'img',
fittype: 'cover',
disableCrossDomain: 'true'
});
</script>

----

Expand Down
1 change: 0 additions & 1 deletion tests/index-parse-large-css.html

Large diffs are not rendered by default.

0 comments on commit d8132d9

Please sign in to comment.