Skip to content

Commit 86119b3

Browse files
Added the integrity attribute
1 parent 4f3fc56 commit 86119b3

File tree

3 files changed

+6
-7
lines changed

3 files changed

+6
-7
lines changed

index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,11 +40,11 @@ module.exports = {
4040
},
4141
link: {
4242
selector: 'link',
43-
attributes: ['rel', 'href']
43+
attributes: ['rel', 'href', 'integrity']
4444
},
4545
script: {
4646
selector: 'script',
47-
attributes: ['src']
47+
attributes: ['src', 'integrity']
4848
}
4949
}
5050
},

tests/fixtures/dist/index.html

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,12 @@
1010
<base href="/" />
1111
<meta name="my-app/config/environment" content="some-config-values" />
1212

13-
<link rel="stylesheet" href="assets/vendor.css">
13+
<link rel="stylesheet" href="assets/vendor.css" integrity="sha256-oqVuAfXRKap7fdgcCY5uykM6+R9GqQ8K/uxy9rx7HNQlGYl1kPzQho1wx4JwY8wC">
1414
<link rel="stylesheet" href="assets/app.css">
1515

1616
</head>
1717
<body>
18-
<script src="assets/vendor.js"></script>
18+
<script src="assets/vendor.js" integrity="sha256-oqVuAfXRKap7fdgcCY5uykM6+R9GqQ8K/uxy9rx7HNQlGYl1kPzQho1wx4JwY8wC"></script>
1919
<script src="assets/app.js"></script>
2020
</body>
2121
</html>
22-

tests/unit/index-nodetest.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,9 +69,9 @@ describe('the deploy plugin object', function() {
6969

7070
assert.deepEqual(json.base[0], { href: '/' });
7171
assert.deepEqual(json.meta[0], { name: 'my-app/config/environment', content: 'some-config-values' });
72-
assert.deepEqual(json.link[0], { rel: 'stylesheet', href: 'assets/vendor.css' });
72+
assert.deepEqual(json.link[0], { rel: 'stylesheet', href: 'assets/vendor.css', integrity: 'sha256-oqVuAfXRKap7fdgcCY5uykM6+R9GqQ8K/uxy9rx7HNQlGYl1kPzQho1wx4JwY8wC' });
7373
assert.deepEqual(json.link[1], { rel: 'stylesheet', href: 'assets/app.css' });
74-
assert.deepEqual(json.script[0], { src: 'assets/vendor.js' });
74+
assert.deepEqual(json.script[0], { src: 'assets/vendor.js', integrity: 'sha256-oqVuAfXRKap7fdgcCY5uykM6+R9GqQ8K/uxy9rx7HNQlGYl1kPzQho1wx4JwY8wC' });
7575
assert.deepEqual(json.script[1], { src: 'assets/app.js' });
7676
});
7777
});

0 commit comments

Comments
 (0)