File tree 2 files changed +9
-2
lines changed
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`).
7
7
8
8
## [ Unreleased]
9
9
10
+ ### Fixed
11
+
12
+ - Apps being unable to ` fetch() ` anything because of ` connect-src ` CSP
13
+
10
14
## [ 0.17.0] [ ] - 2023-06-08
11
15
12
16
### Added
Original file line number Diff line number Diff line change @@ -10,7 +10,8 @@ import type { Info } from "../types/info";
10
10
import type { Instance } from "../types/instance" ;
11
11
12
12
const 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 } ;\
14
15
style-src 'self' 'unsafe-inline' blob: ;\
15
16
font-src 'self' data: blob: ;\
16
17
script-src 'self' 'unsafe-inline' 'unsafe-eval' blob: ;\
@@ -171,7 +172,9 @@ function getContentSecurityPolicy(
171
172
return policy ;
172
173
}
173
174
174
- return policy + `connect-src ${ connectSrcUrls . join ( " " ) } ;` ;
175
+ return (
176
+ policy + `connect-src ${ DEFAULT_SRC_VALUES } ${ connectSrcUrls . join ( " " ) } ;`
177
+ ) ;
175
178
}
176
179
177
180
function wsUrl ( httpUrl : string ) : string {
You can’t perform that action at this time.
0 commit comments