work around broken csp in safari

pull/4428/head
Niklas Fiekas 2018-06-28 14:53:22 +02:00
parent 9c92554a2f
commit 4be94e2589
1 changed files with 5 additions and 1 deletions

View File

@ -13,7 +13,11 @@ case class ContentSecurityPolicy(
private def withScriptSrc(source: String) = copy(scriptSrc = source :: scriptSrc)
def withNonce(nonce: Nonce) = withScriptSrc(nonce.scriptSrc)
def withNonce(nonce: Nonce) = copy(
// Nonces are not supported by Safari but 'unsafe-inline' is ignored by
// better browsers if there are also nonces.
scriptSrc = nonce.scriptSrc :: "'unsafe-inline'" :: scriptSrc
)
def withStripe = copy(
connectSrc = "https://*.stripe.com" :: connectSrc,