Skip to content

Commit

Permalink
fix: improve support of electron BrowserWindow with nodeIntegration
Browse files Browse the repository at this point in the history
Co-authored-by: snowflake <[email protected]>
  • Loading branch information
snowflake752 and snowflake authored Jun 25, 2022
1 parent 3f8dde8 commit 9e5ea0f
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/helpers/request.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ const querystring = require('querystring');
const http = require('http');
const https = require('https');
const { once } = require('events');
const { URL } = require('url');

const LRU = require('lru-cache');

Expand Down Expand Up @@ -116,7 +117,7 @@ module.exports = async function request(options, { accessToken, mTLS = false, DP
}

let response;
const req = (url.protocol === 'https:' ? https.request : http.request)(url, opts);
const req = (url.protocol === 'https:' ? https.request : http.request)(url.href, opts);
return (async () => {
if (json) {
send(req, JSON.stringify(json), 'application/json');
Expand Down

0 comments on commit 9e5ea0f

Please sign in to comment.