Skip to content

Commit

Permalink
Using WHATWG URL rather than the legacy APIs.
Browse files Browse the repository at this point in the history
Signed-off-by: Simone Bordet <[email protected]>
  • Loading branch information
sbordet committed Dec 19, 2023
1 parent f752fdd commit 56c48cf
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions cometd-nodejs-client.js
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ module.exports = {
}
if (isIncluded) {
_debug('proxying', serverURI.href, 'via', proxy);
const agentOpts = Object.assign(url.parse(proxy), _agentOptions);
const agentOpts = Object.assign(new url.URL(proxy), _agentOptions);
return _secure(serverURI) ? new HttpsProxyAgent(agentOpts) : new HttpcProxyAgent(agentOpts);
}
}
Expand All @@ -197,7 +197,7 @@ module.exports = {
this.responseText = '';

this.open = (method, uri) => {
_config = url.parse(uri);
_config = new url.URL(uri);
_config.agent = _chooseAgent(_config);
_config.method = method;
_config.headers = {};
Expand Down

0 comments on commit 56c48cf

Please sign in to comment.