slackhq / csp-html-webpack-plugin

A plugin which, when combined with HTMLWebpackPlugin, adds CSP tags to the HTML output.
MIT License
164 stars 39 forks source link

If plugin is disabled, we should not modify the html at all #28

Closed AnujRNair closed 5 years ago

AnujRNair commented 5 years ago

Summary

When a CSP plugin instance is disabled, we should not modify the HTML at all, as proposed in this PR comment: https://github.com/slackhq/csp-html-webpack-plugin/pull/16#issuecomment-444726998

This means that cheerio won't add empty HTML tags to the file it is modifying, potentially causing incorrect HTML markup

Requirements (place an x in each [ ])

codecov[bot] commented 5 years ago

Codecov Report

Merging #28 into master-v3 will decrease coverage by 0.1%. The diff coverage is 100%.

Impacted file tree graph

@@             Coverage Diff              @@
##           master-v3     #28      +/-   ##
============================================
- Coverage      93.91%   93.8%   -0.11%     
============================================
  Files              2       2              
  Lines            115     113       -2     
  Branches          21      21              
============================================
- Hits             108     106       -2     
  Misses             6       6              
  Partials           1       1
Impacted Files Coverage Δ
plugin.js 92.3% <100%> (-0.17%) :arrow_down:

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 cf2984d...3a71f7d. Read the comment docs.