Skip to content

Commit 0f05dea

Browse files
authored
Improve CSP directive (#944)
* Remove duplicate url from script-src * Add tile.openstreetmap.org to directive
1 parent e54f2ae commit 0f05dea

File tree

5 files changed

+10
-10
lines changed

5 files changed

+10
-10
lines changed

baremaps-server/src/main/resources/dem/index.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@
2222
<meta charset='utf-8'>
2323
<meta name="viewport" content="width=device-width, initial-scale=1">
2424
<meta http-equiv="Content-Security-Policy" content="
25-
default-src 'self' http://127.0.0.1:* http://localhost:* https://unpkg.com https://baremaps.apache.org;
26-
script-src 'self' http://127.0.0.1:* http://localhost:* https://unpkg.com https://unpkg.com https://baremaps.apache.org 'unsafe-inline';
25+
default-src 'self' http://127.0.0.1:* http://localhost:* https://unpkg.com https://baremaps.apache.org https://tile.openstreetmap.org;
26+
script-src 'self' http://127.0.0.1:* http://localhost:* https://unpkg.com https://baremaps.apache.org 'unsafe-inline';
2727
worker-src 'self' blob:;
2828
child-src 'self' blob:;
2929
img-src 'self' data: blob: http://127.0.0.1:* http://localhost:* https://unpkg.com https://baremaps.apache.org;

baremaps-server/src/main/resources/static/server.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@
1818
<html lang="en">
1919
<head>
2020
<meta http-equiv="Content-Security-Policy" content="
21-
default-src 'self' http://127.0.0.1:* http://localhost:* https://unpkg.com https://baremaps.apache.org;
22-
script-src 'self' http://127.0.0.1:* http://localhost:* https://unpkg.com https://unpkg.com https://baremaps.apache.org 'unsafe-inline';
21+
default-src 'self' http://127.0.0.1:* http://localhost:* https://unpkg.com https://baremaps.apache.org https://tile.openstreetmap.org;
22+
script-src 'self' http://127.0.0.1:* http://localhost:* https://unpkg.com https://baremaps.apache.org 'unsafe-inline';
2323
worker-src 'self' blob:;
2424
child-src 'self' blob:;
2525
img-src 'self' data: blob: http://127.0.0.1:* http://localhost:* https://unpkg.com https://baremaps.apache.org;

baremaps-server/src/main/resources/static/viewer.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@
1818
<html lang="en">
1919
<head>
2020
<meta http-equiv="Content-Security-Policy" content="
21-
default-src 'self' http://127.0.0.1:* http://localhost:* https://unpkg.com https://baremaps.apache.org;
22-
script-src 'self' http://127.0.0.1:* http://localhost:* https://unpkg.com https://unpkg.com https://baremaps.apache.org 'unsafe-inline';
21+
default-src 'self' http://127.0.0.1:* http://localhost:* https://unpkg.com https://baremaps.apache.org https://tile.openstreetmap.org;
22+
script-src 'self' http://127.0.0.1:* http://localhost:* https://unpkg.com https://baremaps.apache.org 'unsafe-inline';
2323
worker-src 'self' blob:;
2424
child-src 'self' blob:;
2525
img-src 'self' data: blob: http://127.0.0.1:* http://localhost:* https://unpkg.com https://baremaps.apache.org;

basemap/index.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@
1818
<html lang="en">
1919
<head>
2020
<meta http-equiv="Content-Security-Policy" content="
21-
default-src 'self' http://127.0.0.1:* http://localhost:* https://unpkg.com https://baremaps.apache.org;
22-
script-src 'self' http://127.0.0.1:* http://localhost:* https://unpkg.com https://unpkg.com https://baremaps.apache.org 'unsafe-inline';
21+
default-src 'self' http://127.0.0.1:* http://localhost:* https://unpkg.com https://baremaps.apache.org https://tile.openstreetmap.org;
22+
script-src 'self' http://127.0.0.1:* http://localhost:* https://unpkg.com https://baremaps.apache.org 'unsafe-inline';
2323
worker-src 'self' blob:;
2424
child-src 'self' blob:;
2525
img-src 'self' data: blob: http://127.0.0.1:* http://localhost:* https://unpkg.com https://baremaps.apache.org;

examples/openstreetmap/index.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@
1818
<html lang="en">
1919
<head>
2020
<meta http-equiv="Content-Security-Policy" content="
21-
default-src 'self' http://127.0.0.1:* http://localhost:* https://unpkg.com https://baremaps.apache.org;
22-
script-src 'self' http://127.0.0.1:* http://localhost:* https://unpkg.com https://unpkg.com https://baremaps.apache.org 'unsafe-inline';
21+
default-src 'self' http://127.0.0.1:* http://localhost:* https://unpkg.com https://baremaps.apache.org https://tile.openstreetmap.org;
22+
script-src 'self' http://127.0.0.1:* http://localhost:* https://unpkg.com https://baremaps.apache.org 'unsafe-inline';
2323
worker-src 'self' blob:;
2424
child-src 'self' blob:;
2525
img-src 'self' data: blob: http://127.0.0.1:* http://localhost:* https://unpkg.com https://baremaps.apache.org;

0 commit comments

Comments
 (0)