New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details
Socket
Book a DemoSign in
Socket

simple-csp

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

simple-csp

Very simple Content Security Policy manager

latest
npmnpm
Version
0.2.0
Version published
Weekly downloads
5
150%
Maintainers
1
Weekly downloads
 
Created
Source

Very simple Content Security Policy (CSP) manager

Usage

var express = require( 'express' );
var app = express();
var csp = require( "simple-csp" );

var csp_headers = {
    "default-src": ["'self'", "http://example.com"],
    "connect-src": ["'self'", "http://example.com"],
    "img-src": ["'self'", "data:", "http://example.com"]
};

app.use( "/", function ( req, res, done ) {
    csp.header( csp_headers, res );
    done();
} );

// Static files from ./public
app.use( "/", express.static( "./public" ) );

app.listen( 8888 );

Keywords

content

FAQs

Package last updated on 11 Sep 2023

Did you know?

Socket

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