PlugContentSecurityPolicy v0.2.0 PlugContentSecurityPolicy View Source

A Plug module for inserting a Content Security Policy header into the response. Supports generating nonces as specified in CSP Level 2.

Link to this section Summary

Functions

Callback implementation for Plug.call/2

Accepts the following options

Link to this section Functions

Callback implementation for Plug.call/2.

Accepts the following options:

  • :directives: Map of CSP directives with values as lists of strings
  • :nonces_for: List of CSP directive keys to generate nonces for
  • :report_only: Use the content-security-policy-report-only header instead of the content-security-policy header.

See README for usage details.