PlugContentSecurityPolicy v0.1.1 PlugContentSecurityPolicy

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

Summary

Functions

Callback implementation for Plug.call/2

Accepts the following options

Functions

call(conn, value)
call(Plug.Conn.t, String.t | map | keyword) :: Plug.Conn.t

Callback implementation for Plug.call/2.

init(config)
init(map | keyword) :: String.t | map | keyword

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

See README for usage details.