File tree Expand file tree Collapse file tree 2 files changed +9
-2
lines changed
Expand file tree Collapse file tree 2 files changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -7,6 +7,10 @@ release date when you use `npm version` (see `README.md`).
77
88## [ Unreleased]
99
10+ ### Fixed
11+
12+ - Apps being unable to ` fetch() ` anything because of ` connect-src ` CSP
13+
1014## [ 0.17.0] [ ] - 2023-06-08
1115
1216### Added
Original file line number Diff line number Diff line change @@ -10,7 +10,8 @@ import type { Info } from "../types/info";
1010import type { Instance } from "../types/instance" ;
1111
1212const SIMULATOR_PATHS = [ "/webxdc.js" , "/webxdc" , "/webxdc/.websocket" ] ;
13- const CONTENT_SECURITY_POLICY = `default-src 'self';\
13+ const DEFAULT_SRC_VALUES = "'self'" ;
14+ const CONTENT_SECURITY_POLICY = `default-src ${ DEFAULT_SRC_VALUES } ;\
1415style-src 'self' 'unsafe-inline' blob: ;\
1516font-src 'self' data: blob: ;\
1617script-src 'self' 'unsafe-inline' 'unsafe-eval' blob: ;\
@@ -171,7 +172,9 @@ function getContentSecurityPolicy(
171172 return policy ;
172173 }
173174
174- return policy + `connect-src ${ connectSrcUrls . join ( " " ) } ;` ;
175+ return (
176+ policy + `connect-src ${ DEFAULT_SRC_VALUES } ${ connectSrcUrls . join ( " " ) } ;`
177+ ) ;
175178}
176179
177180function wsUrl ( httpUrl : string ) : string {
You can’t perform that action at this time.
0 commit comments