Outerfaces.Odd.Plugs.OddCDNConsumerContentSecurityPlug (Outerfaces Dependency Distribution (ODD) v0.2.5)

View Source

A plug for setting Content Security Policy headers on responses. To configure the CSP, pass a map of key-value pairs to the plug.

Supports two modes:

  • use_self_policy: true - Simple 'self' based policy for unified proxy mode
  • source_host_options: [...] - Explicit allowed sources list (default)

Summary

Functions

call(conn, opts)

@spec call(Plug.Conn.t(), Keyword.t()) :: Plug.Conn.t()

generate_nonce()

@spec generate_nonce() :: String.t()

init(opts \\ [])

@spec init(Keyword.t()) :: Keyword.t()

maybe_inject_nonce(conn)

@spec maybe_inject_nonce(Plug.Conn.t()) :: Plug.Conn.t()