From 9e5ea0facee3eec6b16b647c3e891cbb126fc32e Mon Sep 17 00:00:00 2001 From: snowfy <40699134+snowflake752@users.noreply.github.com> Date: Sat, 25 Jun 2022 16:25:50 +0530 Subject: [PATCH] fix: improve support of electron BrowserWindow with nodeIntegration Co-authored-by: snowflake --- lib/helpers/request.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/helpers/request.js b/lib/helpers/request.js index d634c6de..45e4f881 100644 --- a/lib/helpers/request.js +++ b/lib/helpers/request.js @@ -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'); @@ -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');