Skip to content

Commit

Permalink
only set CSP to altair protocol
Browse files Browse the repository at this point in the history
  • Loading branch information
imolorhe committed Jun 18, 2024
1 parent 7e47488 commit e656456
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions packages/altair-electron/src/app/window.ts
Original file line number Diff line number Diff line change
Expand Up @@ -285,6 +285,13 @@ export class WindowManager {
}

session.defaultSession.webRequest.onHeadersReceived((details, callback) => {
try {
const u = new url.URL(details.url);
// we only want to set the CSP for the altair custom protocol
if (u.protocol !== ALTAIR_CUSTOM_PROTOCOL + ':') {
return callback({ responseHeaders: details.responseHeaders });
}
} catch {}
if (
details.resourceType === 'mainFrame' ||
details.resourceType === 'subFrame'
Expand Down

0 comments on commit e656456

Please sign in to comment.