docs: Fix CSP header setting of sample code (#15313)
* Fix CSP header setting of sample code Patch for #15310 * Update docs/tutorial/security.md Co-Authored-By: masatokinugawa <masatokinugawa+github@gmail.com>
This commit is contained in:
parent
ca4b4709e5
commit
43a8b6039e
1 changed files with 6 additions and 1 deletions
|
@ -364,7 +364,12 @@ handler:
|
|||
const { session } = require('electron')
|
||||
|
||||
session.defaultSession.webRequest.onHeadersReceived((details, callback) => {
|
||||
callback({ responseHeaders: `default-src 'none'` })
|
||||
callback({
|
||||
responseHeaders: {
|
||||
...details.responseHeaders,
|
||||
'Content-Security-Policy': ['default-src \'none\'']
|
||||
}
|
||||
})
|
||||
})
|
||||
```
|
||||
|
||||
|
|
Loading…
Reference in a new issue