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

Adding ability to overwrite the default processFn method with a custom one. #58

Closed AnujRNair closed 4 years ago

AnujRNair commented 4 years ago

Summary

This PR allows a developer to define a custom processFn method to overwrite the default behaviour of inlining the policy into the head of the document we're currently processing.

Covers a request from https://github.com/slackhq/csp-html-webpack-plugin/pull/44, and an issue raised in https://github.com/slackhq/csp-html-webpack-plugin/issues/57

Implementation Details

codecov[bot] commented 4 years ago

Codecov Report

Merging #58 into master will increase coverage by 0.20%. The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #58      +/-   ##
==========================================
+ Coverage   93.85%   94.06%   +0.20%     
==========================================
  Files           2        2              
  Lines         114      118       +4     
  Branches       22       22              
==========================================
+ Hits          107      111       +4     
  Misses          6        6              
  Partials        1        1              
Impacted Files Coverage Δ
plugin.js 92.70% <100.00%> (+0.31%) :arrow_up:

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 f05fd49...b56efa7. Read the comment docs.

fcsonline commented 4 years ago

Awesome! Thanks!

jasonTheNorris commented 4 years ago

Nice! Give the people what they want! One little nit, but otherwise looks good. +1

AnujRNair commented 4 years ago

I've now merged this and bumped the npm package version - thanks for the reviews!