Skip to content

Commit 5d22c18

Browse files
lognaturelalxndrsn
authored andcommitted
nginx/csp/frontend: fix: OpenLayers (map) worker-src
Split from https://github.com/getodk/central/pull/1526/files#r2587794987 The only identifiable Worker in frontend is from OpenLayers for displaying maps, and requires blob:, not data:. Incorrect map-specific CSP introduced in getodk#1468.
1 parent 2ddd987 commit 5d22c18

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

files/nginx/odk.conf.template

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@ server {
186186

187187
# Rules set to 'none' here would fallback to default-src if excluded.
188188
# They are included here to ease interpretation of violation reports.
189-
add_header Content-Security-Policy-Report-Only "default-src 'none'; connect-src 'self' https://translate.google.com https://translate.googleapis.com; font-src 'self'; frame-src 'self' https://getodk.github.io/central/news.html; img-src * data: https://translate.google.com; manifest-src 'none'; media-src 'none'; object-src 'none'; script-src 'self'; style-src 'self'; style-src-attr 'unsafe-inline'; worker-src data:; report-uri /csp-report";
189+
add_header Content-Security-Policy-Report-Only "default-src 'none'; connect-src 'self' https://translate.google.com https://translate.googleapis.com; font-src 'self'; frame-src 'self' https://getodk.github.io/central/news.html; img-src * data: https://translate.google.com; manifest-src 'none'; media-src 'none'; object-src 'none'; script-src 'self'; style-src 'self'; style-src-attr 'unsafe-inline'; worker-src blob:; report-uri /csp-report";
190190

191191
include /usr/share/odk/nginx/common-headers.conf;
192192
}

test/nginx/test-nginx.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ const contentSecurityPolicies = {
5050
'script-src': self,
5151
'style-src': self,
5252
'style-src-attr': unsafeInline,
53-
'worker-src': 'data:',
53+
'worker-src': 'blob:',
5454
'report-uri': '/csp-report',
5555
}),
5656
'disallow-all': {

0 commit comments

Comments
 (0)