File tree Expand file tree Collapse file tree 3 files changed +18
-1
lines changed Expand file tree Collapse file tree 3 files changed +18
-1
lines changed Original file line number Diff line number Diff line change @@ -15,6 +15,14 @@ declare namespace electronServe {
15
15
*/
16
16
scheme ?: string ;
17
17
18
+ /**
19
+ Whether [CORS](https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS) should be enabled.
20
+ Useful for testing purposes.
21
+
22
+ @default true
23
+ */
24
+ isCorsEnabled ?: boolean ;
25
+
18
26
/**
19
27
The partition the protocol should be installed to, if you're not using Electron's default partition.
20
28
Original file line number Diff line number Diff line change @@ -25,6 +25,7 @@ const getPath = async path_ => {
25
25
26
26
module . exports = options => {
27
27
options = Object . assign ( {
28
+ isCorsEnabled : true ,
28
29
scheme : 'app'
29
30
} , options ) ;
30
31
@@ -57,7 +58,7 @@ module.exports = options => {
57
58
secure : true ,
58
59
allowServiceWorkers : true ,
59
60
supportFetchAPI : true ,
60
- corsEnabled : true
61
+ corsEnabled : options . isCorsEnabled
61
62
}
62
63
}
63
64
] ) ;
Original file line number Diff line number Diff line change @@ -57,6 +57,14 @@ Default: `'app'`
57
57
58
58
Custom scheme. For example, ` foo ` results in your ` directory ` being available at ` foo://- ` .
59
59
60
+ ##### isCorsEnabled
61
+
62
+ Type: ` boolean ` \
63
+ Default: ` true `
64
+
65
+ Whether [ CORS] ( https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS ) should be enabled.
66
+ Useful for testing purposes.
67
+
60
68
##### partition
61
69
62
70
Type: ` string ` \
You can’t perform that action at this time.
0 commit comments