Skip to content

Conversation

@AnujRNair
Copy link
Contributor

@AnujRNair AnujRNair commented Dec 19, 2018

Summary

Previously, we added functionality to not generate hashes if unsafe-inline was specifically added to a policy by a developer, however, this breaks csp backwards compatibility with older browsers.

According to MDN:

Specifying nonce makes a modern browser ignore 'unsafe-inline' which could still be set for older browsers without nonce support

The same applies to hashes

This PR has added in a new config option (devAllowUnsafe) to allow the developer to stop inline hash processing if set. Otherwise, a policy will be created with both unsafe-inline and inline script hashes

Requirements (place an x in each [ ])

Anuj Nair added 2 commits December 19, 2018 11:25
@codecov
Copy link

codecov bot commented Dec 19, 2018

Codecov Report

Merging #22 into master will increase coverage by 0.09%.
The diff coverage is 100%.

Impacted file tree graph

@@ Coverage Diff @@ ## master #22 +/- ## ========================================== + Coverage 98.79% 98.88% +0.09%  ========================================== Files 2 2 Lines 166 180 +14 Branches 9 12 +3 ========================================== + Hits 164 178 +14  Misses 2 2
Impacted Files Coverage Δ
spec/plugin.spec.js 100% <100%> (ø) ⬆️
plugin.js 96.92% <100%> (+0.14%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update a081bc2...75a9a83. Read the comment docs.

@AnujRNair AnujRNair merged commit 1cedba7 into master Dec 19, 2018
@AnujRNair AnujRNair deleted the an-option-for-disabling-unsafe-inline branch December 19, 2018 19:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

2 participants