【文件属性】:
文件名称:inline-csp-hash:插件为CSP的内联脚本和样式生成哈希
文件大小:72KB
文件格式:ZIP
更新时间:2021-04-29 03:30:45
gulp csp content-security-policy JavaScript
内联csp哈希
用于为CSP的内联脚本和样式生成哈希的插件。
该插件受约束,并且操作方式大致相同。
安装
npm install inline-csp-hash --save
用法
const gulp = require ( 'gulp' ) ;
const hashstream = require ( 'inline-csp-hash' ) ;
gulp . task ( 'inline-hash' , ( ) => {
return gulp . src ( 'src/*.html' )
. pipe ( hashstream ( {
what : 'script' ,
replace_cb : ( s , hashes ) => s . replace ( / script-src 'self' [ ^; ] * / , "script-sr
【文件预览】:
inline-csp-hash-master
----.github()
--------dependabot.yml(204B)
--------workflows()
----LICENSE(1KB)
----README.md(2KB)
----.npmrc(38B)
----tests()
--------fixtures()
--------test.js(3KB)
----.gitignore(40B)
----index.js(1KB)
----package-lock.json(284KB)
----package.json(915B)