Skip to content

Commit

Permalink
fix(csp): add 'self' (#1794)
Browse files Browse the repository at this point in the history
Co-authored-by: Lucas Nogueira <lucas@tauri.studio>
  • Loading branch information
nothingismagick and lucasfernog authored May 12, 2021
1 parent 71f6a5e commit 12268e6
Show file tree
Hide file tree
Showing 12 changed files with 16 additions and 11 deletions.
5 changes: 5 additions & 0 deletions .changes/csp-self.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"cli.rs": patch
---

Add `'self'` to default CSP because otherwise no joy on macOS.
2 changes: 1 addition & 1 deletion core/tauri/test/fixture/src-tauri/tauri.conf.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
}
],
"security": {
"csp": "default-src blob: data: filesystem: ws: http: https: 'unsafe-eval' 'unsafe-inline'"
"csp": "default-src blob: data: filesystem: ws: http: https: 'unsafe-eval' 'unsafe-inline' 'self'"
},
"updater": {
"active": false
Expand Down
2 changes: 1 addition & 1 deletion examples/api/src-tauri/tauri.conf.json
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@
}
],
"security": {
"csp": "default-src blob: data: filesystem: ws: http: https: 'unsafe-eval' 'unsafe-inline' img-src: 'self'"
"csp": "default-src blob: data: filesystem: ws: http: https: 'unsafe-eval' 'unsafe-inline' 'self' img-src: 'self'"
},
"systemTray": {
"iconPath": "../../.icons/icon.png"
Expand Down
2 changes: 1 addition & 1 deletion examples/commands/src-tauri/tauri.conf.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
}
],
"security": {
"csp": "default-src blob: data: filesystem: ws: http: https: 'unsafe-eval' 'unsafe-inline'"
"csp": "default-src blob: data: filesystem: ws: http: https: 'unsafe-eval' 'unsafe-inline' 'self'"
},
"updater": {
"active": false
Expand Down
2 changes: 1 addition & 1 deletion examples/helloworld/src-tauri/tauri.conf.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
}
],
"security": {
"csp": "default-src blob: data: filesystem: ws: http: https: 'unsafe-eval' 'unsafe-inline'"
"csp": "default-src blob: data: filesystem: ws: http: https: 'unsafe-eval' 'unsafe-inline' 'self'"
},
"updater": {
"active": false
Expand Down
2 changes: 1 addition & 1 deletion examples/multiwindow/src-tauri/tauri.conf.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
}
],
"security": {
"csp": "default-src blob: data: filesystem: ws: http: https: 'unsafe-eval' 'unsafe-inline'"
"csp": "default-src blob: data: filesystem: ws: http: https: 'unsafe-eval' 'unsafe-inline' 'self'"
},
"updater": {
"active": false
Expand Down
2 changes: 1 addition & 1 deletion examples/navigation/src-tauri/tauri.conf.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
}
],
"security": {
"csp": "default-src blob: data: filesystem: ws: http: https: 'unsafe-eval' 'unsafe-inline'"
"csp": "default-src blob: data: filesystem: ws: http: https: 'unsafe-eval' 'unsafe-inline' 'self'"
},
"updater": {
"active": false
Expand Down
2 changes: 1 addition & 1 deletion examples/params/src-tauri/tauri.conf.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
}
],
"security": {
"csp": "default-src blob: data: filesystem: ws: http: https: 'unsafe-eval' 'unsafe-inline'"
"csp": "default-src blob: data: filesystem: ws: http: https: 'unsafe-eval' 'unsafe-inline' 'self'"
},
"updater": {
"active": false
Expand Down
2 changes: 1 addition & 1 deletion examples/splashscreen/src-tauri/tauri.conf.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
}
],
"security": {
"csp": "default-src blob: data: filesystem: ws: http: https: 'unsafe-eval' 'unsafe-inline' img-src: 'self'"
"csp": "default-src blob: data: filesystem: ws: http: https: 'unsafe-eval' 'unsafe-inline' 'self' img-src: 'self'"
},
"updater": {
"active": false
Expand Down
2 changes: 1 addition & 1 deletion examples/state/src-tauri/tauri.conf.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
}
],
"security": {
"csp": "default-src blob: data: filesystem: ws: http: https: 'unsafe-eval' 'unsafe-inline'"
"csp": "default-src blob: data: filesystem: ws: http: https: 'unsafe-eval' 'unsafe-inline' 'self'"
},
"updater": {
"active": false
Expand Down
2 changes: 1 addition & 1 deletion examples/updater/src-tauri/tauri.conf.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
}
],
"security": {
"csp": "default-src blob: data: filesystem: ws: http: https: 'unsafe-eval' 'unsafe-inline'"
"csp": "default-src blob: data: filesystem: ws: http: https: 'unsafe-eval' 'unsafe-inline' 'self'"
},
"updater": {
"active": true,
Expand Down
2 changes: 1 addition & 1 deletion tooling/cli.rs/templates/src-tauri/tauri.conf.json
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@
}
],
"security": {
"csp": "default-src blob: data: filesystem: ws: http: https: 'unsafe-eval' 'unsafe-inline' img-src: 'self'"
"csp": "default-src blob: data: filesystem: ws: http: https: 'unsafe-eval' 'unsafe-inline' 'self' img-src: 'self'"
}
}
}

0 comments on commit 12268e6

Please sign in to comment.