Socket
Socket
Sign inDemoInstall

content-security-policy-builder

Package Overview
Dependencies
1
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    content-security-policy-builder

Build Content Security Policy directives.


Version published
Maintainers
1
Install size
9.58 kB
Created

Readme

Source

Content Security Policy builder

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:

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

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

Keywords

FAQs

Last updated on 18 Sep 2015

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc