This package has been deprecated

Author message:

Use koa-helmet

koa-feature-policy

0.5.1 • Public • Published

koa-feature-policy

Deprecated

Feature-Policy has been added to Helmet, so please use koa-helmet to add this header (and lots of other great security header fixes) to your Koa apps.


Small library for adding a Feature-Policy to Koa responses.

IMPORTANT Feature-Policy is experimental, so this library might change frequently until the new header is stable.


Installation

npm i koa-feature-policy

Usage

import featurePolicy from 'koa-feature-policy'
 
// set up koa
 
const options = {
  /* directive: allowlist */
  vibrate: ["'self'", 'https://example.com']
}
 
app.use(featurePolicy(options))
 
// call app.listen

See MDN for the full list of directives.

This library converts camelCase directives to lisp-case. So use ambientLightSensor, not 'ambient-light-sensor'.

License

MIT

Package Sidebar

Install

npm i koa-feature-policy

Weekly Downloads

0

Version

0.5.1

License

MIT

Unpacked Size

6.55 kB

Total Files

9

Last publish

Collaborators

  • zacanger