Skip to content

Commit

Permalink
Enable inline styles in the site's CSP policy (#4445)
Browse files Browse the repository at this point in the history
Blocking inline styles prevents the client's adder toolbar from working
properly on /docs/help and other pages on the site until
hypothesis/client#293 is resolved.
  • Loading branch information
robertknight authored and nickstenning committed Mar 22, 2017
1 parent 732dc4d commit 820a527
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion h/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,12 @@ def includeme(config):
settings['csp'] = {
"font-src": ["'self'", "fonts.gstatic.com", client_host],
"script-src": ["'self'", client_host, "www.google-analytics.com"],
"style-src": ["'self'", "fonts.googleapis.com", client_host],

# Allow inline styles until https://github.com/hypothesis/client/issues/293
# is resolved as otherwise our own tool would break on the site,
# including on /docs/help.
"style-src": ["'self'", "fonts.googleapis.com", client_host,
"'unsafe-inline'"],
}
if 'csp.report_uri' in settings:
settings['csp']['report-uri'] = [settings['csp.report_uri']]
Expand Down

0 comments on commit 820a527

Please sign in to comment.