mirror of
https://github.com/nodejs/node.git
synced 2026-11-27 17:52:27 -05:00
Node instance may not know the real host and port user sees when debug frontend connects through the SSH tunnel. This change fixes '/json/list' response by using the value client provided in the host header. PR-URL: https://github.com/nodejs/node/pull/19664 Reviewed-By: Tiancheng "Timothy" Gu <timothygu99@gmail.com>
23 lines
600 B
JavaScript
23 lines
600 B
JavaScript
// Flags: --expose-internals
|
|
'use strict';
|
|
const common = require('../common');
|
|
|
|
common.skipIfInspectorDisabled();
|
|
|
|
const assert = require('assert');
|
|
const { NodeInstance } = require('../common/inspector-helper.js');
|
|
|
|
common.crashOnUnhandledRejection();
|
|
|
|
async function test() {
|
|
const madeUpHost = '111.111.111.111:11111';
|
|
const child = new NodeInstance(undefined, 'var a = 1');
|
|
const response = await child.httpGet(null, '/json', madeUpHost);
|
|
assert.ok(
|
|
response[0].webSocketDebuggerUrl.startsWith(`ws://${madeUpHost}`),
|
|
response[0].webSocketDebuggerUrl);
|
|
child.kill();
|
|
}
|
|
|
|
test();
|