Skip to content

Commit

Permalink
debugger: use internal/url.URL instead of url.parse
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
LiviaMedeiros authored and nodejs-github-bot committed Sep 13, 2023
1 parent ccf46ba commit 2a0e5de
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions lib/internal/debugger/inspect_client.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ const crypto = require('crypto');
const { ERR_DEBUGGER_ERROR } = require('internal/errors').codes;
const { EventEmitter } = require('events');
const http = require('http');
const URL = require('url');
const { URL } = require('internal/url');

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

Expand Down Expand Up @@ -297,7 +297,8 @@ class Client extends EventEmitter {

async _discoverWebsocketPath() {
const { 0: { webSocketDebuggerUrl } } = await this._fetchJSON('/json');
return URL.parse(webSocketDebuggerUrl).path;
const { pathname, search } = new URL(webSocketDebuggerUrl);
return `${pathname}${search}`;
}

_connectWebsocket(urlPath) {
Expand Down

0 comments on commit 2a0e5de

Please sign in to comment.