dijkstra-backend-cloudron/node_modules/content-security-policy-bui...
rui hildt 4f5db9ab26 Add initial version of dijkstra backend cloudron image 2020-10-12 11:27:15 +02:00
..
dist Add initial version of dijkstra backend cloudron image 2020-10-12 11:27:15 +02:00
CHANGELOG.md Add initial version of dijkstra backend cloudron image 2020-10-12 11:27:15 +02:00
LICENSE Add initial version of dijkstra backend cloudron image 2020-10-12 11:27:15 +02:00
README.md Add initial version of dijkstra backend cloudron image 2020-10-12 11:27:15 +02:00
package.json Add initial version of dijkstra backend cloudron image 2020-10-12 11:27:15 +02:00

README.md

Content Security Policy builder

Build Status

Take an object and turn it into a Content Security Policy string. Useful for building Content Security Policy libraries.

It can handle a lot of things you can you throw at it; camelCased or dash-separated directives, arrays or strings, et cetera.

Usage:

const builder = require('content-security-policy-builder')

// default-src 'self' default.com; script-src scripts.com; whatever-src something; object-src
builder({
  directives: {
    defaultSrc: ["'self'", 'default.com'],
    scriptSrc: 'scripts.com',
    'whatever-src': 'something',
    objectSrc: true
  }
})