aboutsummaryrefslogtreecommitdiffstats
path: root/actionview/app/assets/javascripts/rails-ujs/utils/csp.coffee
blob: a33f531375d9748ad63bd93e23b14d35aa84d432 (plain) (blame)
1
2
3
4
5
6
7
8
nonce = null

Rails.loadCSPNonce = ->
  nonce = document.querySelector("meta[name=csp-nonce]")?.content

# Returns the Content-Security-Policy nonce for inline scripts.
Rails.cspNonce = ->
  nonce ? Rails.loadCSPNonce()