Skip to content

Commit

Permalink
Add Origin header for CORS support (#66)
Browse files Browse the repository at this point in the history
  • Loading branch information
intellix authored and skevy committed Jun 17, 2017
1 parent a07374f commit 065766c
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions main.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,11 @@ app.on('ready', function() {

mainWindow = new BrowserWindow({ width: 1024, height: 728 });

electron.session.defaultSession.webRequest.onBeforeSendHeaders((details, callback) => {
details.requestHeaders['Origin'] = 'electron://graphiql-app';
callback({ cancel: false, requestHeaders: details.requestHeaders });
});

if (process.env.HOT) {
mainWindow.loadURL('file://' + __dirname + '/app/hot-dev-app.html');
} else {
Expand Down

0 comments on commit 065766c

Please sign in to comment.