Skip to content
This repository has been archived by the owner on Dec 12, 2021. It is now read-only.

Commit

Permalink
Add user-defined CORS-settings for script files
Browse files Browse the repository at this point in the history
  • Loading branch information
S1SYPHOS committed Oct 31, 2017
1 parent c0b9939 commit 9d3c700
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion core/js.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

use Asset;
use f;
use c;
use html;

class JS extends \Kirby\Component\JS {
Expand Down Expand Up @@ -51,7 +52,7 @@ public function tag($src, $async = false) {
$attr = array(
'src' => url($src),
'integrity' => $jsIntegrity, // inject generated sri hash
'crossorigin' => 'anonymous'
'crossorigin' => c::get('sri-hash.use-credentials') ? 'use-credentials' : 'anonymous' // set user-defined 'crossorigin' attribute
);

if(is_array($async)) {
Expand Down

0 comments on commit 9d3c700

Please sign in to comment.