Skip to content

Commit bdb8e0e

Browse files
committed
http2: make --expose-http2 flag a non-op
Make the `http2` module always available. The `--expose-http2` cli flag is made a non-op
1 parent bc23681 commit bdb8e0e

File tree

135 files changed

+8
-167
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

135 files changed

+8
-167
lines changed

doc/api/cli.md

Lines changed: 0 additions & 7 deletions

doc/api/http2.md

Lines changed: 0 additions & 3 deletions

doc/node.1

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -130,10 +130,6 @@ Emit pending deprecation warnings.
130130
.BR \-\-no\-warnings
131131
Silence all process warnings (including deprecations).
132132

133-
.TP
134-
.BR \-\-expose\-http2
135-
Enable the experimental `'http2'` module.
136-
137133
.TP
138134
.BR \-\-napi\-modules
139135
Enable loading native modules compiled with the ABI-stable Node.js API (N-API)

lib/internal/bootstrap_node.js

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -509,9 +509,6 @@
509509

510510
const config = process.binding('config');
511511

512-
if (!config.exposeHTTP2)
513-
delete NativeModule._source.http2;
514-
515512
NativeModule.require = function(id) {
516513
if (id === 'native_module') {
517514
return NativeModule;

lib/internal/module.js

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -78,15 +78,11 @@ function stripShebang(content) {
7878

7979
const builtinLibs = [
8080
'assert', 'async_hooks', 'buffer', 'child_process', 'cluster', 'crypto',
81-
'dgram', 'dns', 'domain', 'events', 'fs', 'http', 'https', 'net',
81+
'dgram', 'dns', 'domain', 'events', 'fs', 'http', 'http2', 'https', 'net',
8282
'os', 'path', 'perf_hooks', 'punycode', 'querystring', 'readline', 'repl',
8383
'stream', 'string_decoder', 'tls', 'tty', 'url', 'util', 'v8', 'vm', 'zlib'
8484
];
8585

86-
const { exposeHTTP2 } = process.binding('config');
87-
if (exposeHTTP2)
88-
builtinLibs.push('http2');
89-
9086
function addBuiltinLibsToObject(object) {
9187
// Make built-in modules available directly (loaded lazily).
9288
builtinLibs.forEach((name) => {

src/node.cc

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -244,9 +244,6 @@ std::string config_warning_file; // NOLINT(runtime/string)
244244
// that is used by lib/internal/bootstrap_node.js
245245
bool config_expose_internals = false;
246246

247-
// Set in node.cc by ParseArgs when --expose-http2 is used.
248-
bool config_expose_http2 = false;
249-
250247
bool v8_initialized = false;
251248

252249
bool linux_at_secure = false;
@@ -3792,7 +3789,6 @@ static void PrintHelp() {
37923789
" --abort-on-uncaught-exception\n"
37933790
" aborting instead of exiting causes a\n"
37943791
" core file to be generated for analysis\n"
3795-
" --expose-http2 enable experimental HTTP2 support\n"
37963792
" --trace-warnings show stack traces on process warnings\n"
37973793
" --redirect-warnings=file\n"
37983794
" write warnings to file instead of\n"
@@ -3915,7 +3911,7 @@ static void CheckIfAllowedInEnv(const char* exe, bool is_env,
39153911
"--throw-deprecation",
39163912
"--no-warnings",
39173913
"--napi-modules",
3918-
"--expose-http2",
3914+
"--expose-http2", // keep as a non-op through v9.x
39193915
"--trace-warnings",
39203916
"--redirect-warnings",
39213917
"--trace-sync-io",
@@ -4117,7 +4113,7 @@ static void ParseArgs(int* argc,
41174113
config_expose_internals = true;
41184114
} else if (strcmp(arg, "--expose-http2") == 0 ||
41194115
strcmp(arg, "--expose_http2") == 0) {
4120-
config_expose_http2 = true;
4116+
// Keep as a non-op through v9.x
41214117
} else if (strcmp(arg, "-") == 0) {
41224118
break;
41234119
} else if (strcmp(arg, "--") == 0) {

src/node_config.cc

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -74,9 +74,6 @@ static void InitConfig(Local<Object> target,
7474
if (config_expose_internals)
7575
READONLY_BOOLEAN_PROPERTY("exposeInternals");
7676

77-
if (config_expose_http2)
78-
READONLY_BOOLEAN_PROPERTY("exposeHTTP2");
79-
8077
READONLY_PROPERTY(target,
8178
"bits",
8279
Number::New(env->isolate(), 8 * sizeof(intptr_t)));

src/node_internals.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,8 +86,6 @@ extern std::string openssl_config;
8686
// that is used by lib/module.js
8787
extern bool config_preserve_symlinks;
8888

89-
// Set in node.cc by ParseArgs when --expose-http2 is used.
90-
extern bool config_expose_http2;
9189
// Set in node.cc by ParseArgs when --experimental-modules is used.
9290
// Used in node_config.cc to set a constant on process.binding('config')
9391
// that is used by lib/module.js

test/parallel/test-http2-binding.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
// Flags: --expose-http2
21
'use strict';
32

43
const common = require('../common');

test/parallel/test-http2-client-data-end.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
// Flags: --expose-http2
21
'use strict';
32

43
const common = require('../common');

0 commit comments

Comments
 (0)