`StringUtil::CharacterCount` should return the length of underlying representation storage of a protocol string. `StringUtil::CharacterCount` is only used in DictionaryValue serialization. Only `Network.Headers` is an object type, represented with DictionaryValue. PR-URL: https://github.com/nodejs/node/pull/56788 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com> Reviewed-By: Daniel Lemire <daniel@lemire.me> Reviewed-By: Kohei Ueno <kohei.ueno119@gmail.com>
42 lines
1.2 KiB
JavaScript
42 lines
1.2 KiB
JavaScript
// Flags: --inspect=0 --experimental-network-inspection
|
|
'use strict';
|
|
const common = require('../common');
|
|
|
|
common.skipIfInspectorDisabled();
|
|
|
|
const inspector = require('node:inspector/promises');
|
|
const { Network } = require('node:inspector');
|
|
const test = require('node:test');
|
|
const assert = require('node:assert');
|
|
const { waitUntil } = require('../common/inspector-helper');
|
|
|
|
const session = new inspector.Session();
|
|
session.connect();
|
|
|
|
test('should emit Network.requestWillBeSent with unicode', async () => {
|
|
await session.post('Network.enable');
|
|
const expectedValue = 'CJK 汉字 🍱 🧑🧑🧒🧒';
|
|
|
|
const requestWillBeSentFuture = waitUntil(session, 'Network.requestWillBeSent')
|
|
.then(([event]) => {
|
|
assert.strictEqual(event.params.request.url, expectedValue);
|
|
assert.strictEqual(event.params.request.method, expectedValue);
|
|
assert.strictEqual(event.params.request.headers.mKey, expectedValue);
|
|
});
|
|
|
|
Network.requestWillBeSent({
|
|
requestId: '1',
|
|
timestamp: 1,
|
|
wallTime: 1,
|
|
request: {
|
|
url: expectedValue,
|
|
method: expectedValue,
|
|
headers: {
|
|
mKey: expectedValue,
|
|
},
|
|
},
|
|
});
|
|
|
|
await requestWillBeSentFuture;
|
|
});
|