Skip to content

Commit 8d9177f

Browse files
authored
refactor: update CODEOWNERS and benchmark files to use internal HTTP modules
1 parent 409842a commit 8d9177f

File tree

4 files changed

+14
-21
lines changed

4 files changed

+14
-21
lines changed

.github/CODEOWNERS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@
7575
/lib/https.js @nodejs/crypto @nodejs/net @nodejs/http
7676
/src/node_http_common* @nodejs/http @nodejs/http2 @nodejs/net
7777
/src/node_http_parser.cc @nodejs/http @nodejs/net
78+
/lib/internal/http/* @nodejs/http @nodejs/net
7879

7980
# http2
8081

benchmark/http/check_invalid_header_char.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
'use strict';
22

33
const common = require('../common.js');
4-
// TODO: benchmark has access to internal modules?
5-
const _checkInvalidHeaderChar = require('_http_common')._checkInvalidHeaderChar;
64

75
const groupedInputs = {
86
// Representative set of inputs from an AcmeAir benchmark run:
@@ -52,9 +50,13 @@ const inputs = [
5250
const bench = common.createBenchmark(main, {
5351
input: inputs.concat(Object.keys(groupedInputs)),
5452
n: [1e6],
53+
}, {
54+
flags: ['--expose-internals', '--no-warnings'],
5555
});
5656

5757
function main({ n, input }) {
58+
const checkInvalidHeaderChar = require('internal/http/common')._checkInvalidHeaderChar;
59+
5860
let inputs = [input];
5961
if (Object.hasOwn(groupedInputs, input)) {
6062
inputs = groupedInputs[input];
@@ -63,7 +65,7 @@ function main({ n, input }) {
6365
const len = inputs.length;
6466
bench.start();
6567
for (let i = 0; i < n; i++) {
66-
_checkInvalidHeaderChar(inputs[i % len]);
68+
checkInvalidHeaderChar(inputs[i % len]);
6769
}
6870
bench.end(n);
6971
}

benchmark/http/check_is_http_token.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
'use strict';
22

33
const common = require('../common.js');
4-
// TODO: benchmark has access to internal modules?
5-
const _checkIsHttpToken = require('_http_common')._checkIsHttpToken;
64

75
const bench = common.createBenchmark(main, {
86
key: [
@@ -39,12 +37,16 @@ const bench = common.createBenchmark(main, {
3937
'alternate-protocol:', // slow bailout
4038
],
4139
n: [1e6],
40+
}, {
41+
flags: ['--expose-internals', '--no-warnings'],
4242
});
4343

4444
function main({ n, key }) {
45+
const checkIsHttpToken = require('internal/http/common')._checkIsHttpToken;
46+
4547
bench.start();
4648
for (let i = 0; i < n; i++) {
47-
_checkIsHttpToken(key);
49+
checkIsHttpToken(key);
4850
}
4951
bench.end(n);
5052
}

doc/api/deprecations.md

Lines changed: 3 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -4329,6 +4329,9 @@ Creating SHAKE-128 and SHAKE-256 digests without an explicit `options.outputLeng
43294329

43304330
<!-- YAML
43314331
changes:
4332+
- version: REPLACEME
4333+
pr-url: https://github.com/nodejs/node/pull/58535
4334+
description: Runtime deprecation.
43324335
- version:
43334336
- v24.6.0
43344337
- v22.19.0
@@ -4388,21 +4391,6 @@ import { opendir } from 'node:fs/promises';
43884391
}
43894392
```
43904393
4391-
### DEP0195: `require('node:_http_*')`
4392-
4393-
<!-- YAML
4394-
changes:
4395-
- version: REPLACEME
4396-
pr-url: https://github.com/nodejs/node/pull/58535
4397-
description: Runtime deprecation.
4398-
-->
4399-
4400-
Type: Runtime
4401-
4402-
The `node:_http_agent`, `node:_http_client`, `node:_http_common`, `node:_http_incoming`,
4403-
`node:_http_outgoing` and `node:_http_server` modules are deprecated as they should be considered
4404-
an internal nodejs implementation rather than a public facing API, use `node:http` instead.
4405-
44064394
[DEP0142]: #dep0142-repl_builtinlibs
44074395
[NIST SP 800-38D]: https://nvlpubs.nist.gov/nistpubs/Legacy/SP/nistspecialpublication800-38d.pdf
44084396
[RFC 6066]: https://tools.ietf.org/html/rfc6066#section-3

0 commit comments

Comments
 (0)