helmet-crossdomain

Set the X-Permitted-Cross-Domain-Policies header in Express apps

MIT 5 个版本
安装
npm install helmet-crossdomain
yarn add helmet-crossdomain
pnpm add helmet-crossdomain
bun add helmet-crossdomain
README

X-Permitted-Cross-Domain-Policies middleware

Build Status

The X-Permitted-Cross-Domain-Policies header tells some web clients (like Adobe Flash or Adobe Acrobat) your domain's policy for loading cross-domain content. See the description on OWASP for more.

Usage:

const crossdomain = require('helmet-crossdomain')

// Sets X-Permitted-Cross-Domain-Policies: none
app.use(crossdomain())

// You can use any of the following values:
app.use(crossdomain({ permittedPolicies: 'none' }))
app.use(crossdomain({ permittedPolicies: 'master-only' }))
app.use(crossdomain({ permittedPolicies: 'by-content-type' }))
app.use(crossdomain({ permittedPolicies: 'all' }))

The by-ftp-type is not currently supported. Please open an issue or pull request if you desire this feature!

If you don't expect Adobe products to load data from your site, you get a minor security benefit by adding this header.

版本列表
0.5.0 2019-09-01
0.4.0 2019-06-15
0.3.0 2018-07-22
0.2.0 2018-02-16
0.1.0 2014-08-24