csp: allow twitter embeds in blog posts
parent
4542fc5906
commit
2e214dc6ea
|
@ -10,7 +10,8 @@ title = title,
|
|||
moreCss = cssTag("blog.css"),
|
||||
moreJs = pageJs,
|
||||
side = side,
|
||||
openGraph = openGraph) {
|
||||
openGraph = openGraph,
|
||||
csp = defaultCsp.withTwitter.some) {
|
||||
<div id="lichess_blog" class="content_box">
|
||||
@body
|
||||
</div>
|
||||
|
|
|
@ -40,6 +40,12 @@ case class ContentSecurityPolicy(
|
|||
scriptSrc = Nil
|
||||
)
|
||||
|
||||
def withTwitter = copy(
|
||||
scriptSrc = "https://platform.twitter.com" :: "https://*.twimg.com" :: scriptSrc,
|
||||
childSrc = "https://platform.twitter.com" :: childSrc,
|
||||
styleSrc = "https://platform.twitter.com" :: styleSrc
|
||||
)
|
||||
|
||||
override def toString: String =
|
||||
List(
|
||||
"default-src " -> defaultSrc,
|
||||
|
|
Loading…
Reference in New Issue