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:
Masato Kinugawa 2018-10-23 23:38:48 +09:00 committed by John Kleinschmidt
parent ca4b4709e5
commit 43a8b6039e

View file

@ -364,7 +364,12 @@ handler:
const { session } = require('electron') const { session } = require('electron')
session.defaultSession.webRequest.onHeadersReceived((details, callback) => { session.defaultSession.webRequest.onHeadersReceived((details, callback) => {
callback({ responseHeaders: `default-src 'none'` }) callback({
responseHeaders: {
...details.responseHeaders,
'Content-Security-Policy': ['default-src \'none\'']
}
})
}) })
``` ```