Skip to content

Commit 6fcb51d

Browse files
LiviaMedeirosruyadorno
authored andcommitted
debugger: use internal/url.URL instead of url.parse
PR-URL: #49590 Reviewed-By: Yagiz Nizipli <[email protected]> Reviewed-By: Chemi Atlow <[email protected]> Reviewed-By: Geoffrey Booth <[email protected]> Reviewed-By: Antoine du Hamel <[email protected]> Reviewed-By: Michaël Zasso <[email protected]> Reviewed-By: Luigi Pinca <[email protected]>
1 parent 185d9b5 commit 6fcb51d

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

lib/internal/debugger/inspect_client.js

+3-2
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ const crypto = require('crypto');
1515
const { ERR_DEBUGGER_ERROR } = require('internal/errors').codes;
1616
const { EventEmitter } = require('events');
1717
const http = require('http');
18-
const URL = require('url');
18+
const { URL } = require('internal/url');
1919

2020
const debuglog = require('internal/util/debuglog').debuglog('inspect');
2121

@@ -297,7 +297,8 @@ class Client extends EventEmitter {
297297

298298
async _discoverWebsocketPath() {
299299
const { 0: { webSocketDebuggerUrl } } = await this._fetchJSON('/json');
300-
return URL.parse(webSocketDebuggerUrl).path;
300+
const { pathname, search } = new URL(webSocketDebuggerUrl);
301+
return `${pathname}${search}`;
301302
}
302303

303304
_connectWebsocket(urlPath) {

0 commit comments

Comments
 (0)