Merge pull request #3227 from alphagov/youtube-no-cookie

Serve video from a domain that doesn’t set cookies
This commit is contained in:
Chris Hill-Scott
2019-12-19 15:34:51 +00:00
committed by GitHub
3 changed files with 4 additions and 4 deletions

View File

@@ -558,7 +558,7 @@ def useful_headers_after_request(response):
"object-src 'self';"
"font-src 'self' {asset_domain} data:;"
"img-src 'self' {asset_domain} *.google-analytics.com *.notifications.service.gov.uk {logo_domain} data:;"
"frame-src 'self' www.youtube.com;".format(
"frame-src 'self' www.youtube-nocookie.com;".format(
asset_domain=current_app.config['ASSET_DOMAIN'],
logo_domain=get_logo_cdn_domain(),
)

View File

@@ -110,7 +110,7 @@
</h2>
<div class="responsive-embed responsive-embed--16by9 responsive-embed--bordered bottom-gutter-2">
<div class="responsive-embed__wrapper">
<iframe width="560" height="315" src="https://www.youtube.com/embed/_90cv1YgQo4" frameborder="0" allowfullscreen></iframe>
<iframe width="560" height="315" src="https://www.youtube-nocookie.com/embed/_90cv1YgQo4" frameborder="0" allowfullscreen></iframe>
</div>
</div>
</div>

View File

@@ -21,7 +21,7 @@ def test_owasp_useful_headers_set(
"font-src 'self' static.example.com data:;"
"img-src "
"'self' static.example.com *.google-analytics.com *.notifications.service.gov.uk static-logos.test.com data:;"
"frame-src 'self' www.youtube.com;"
"frame-src 'self' www.youtube-nocookie.com;"
)
@@ -43,5 +43,5 @@ def test_headers_non_ascii_characters_are_replaced(
"font-src 'self' static.example.com data:;"
"img-src "
"'self' static.example.com *.google-analytics.com *.notifications.service.gov.uk static-logos??.test.com data:;"
"frame-src 'self' www.youtube.com;"
"frame-src 'self' www.youtube-nocookie.com;"
)