Skip to content

Commit f55ee6e

Browse files
jasnellBridgeAR
authored andcommitted
http2: make --expose-http2 flag a non-op
Make the `http2` module always available. The `--expose-http2` cli flag is made a non-op PR-URL: #15535 Reviewed-By: Matteo Collina <[email protected]> Reviewed-By: Ali Ijaz Sheikh <[email protected]> Reviewed-By: Ruben Bridgewater <[email protected]>
1 parent e416b3e commit f55ee6e

File tree

142 files changed

+12
-174
lines changed

Some content is hidden

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

142 files changed

+12
-174
lines changed

benchmark/http2/headers.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ const PORT = common.PORT;
66
const bench = common.createBenchmark(main, {
77
n: [1e3],
88
nheaders: [0, 10, 100, 1000],
9-
}, { flags: ['--expose-http2', '--no-warnings'] });
9+
}, { flags: ['--no-warnings'] });
1010

1111
function main(conf) {
1212
const n = +conf.n;

benchmark/http2/respond-with-fd.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ const bench = common.createBenchmark(main, {
1111
requests: [100, 1000, 10000, 100000, 1000000],
1212
streams: [100, 200, 1000],
1313
clients: [1, 2]
14-
}, { flags: ['--expose-http2', '--no-warnings'] });
14+
}, { flags: ['--no-warnings'] });
1515

1616
function main(conf) {
1717

benchmark/http2/simple.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ const bench = common.createBenchmark(main, {
1212
requests: [100, 1000, 10000, 100000],
1313
streams: [100, 200, 1000],
1414
clients: [1, 2]
15-
}, { flags: ['--expose-http2', '--no-warnings'] });
15+
}, { flags: ['--no-warnings'] });
1616

1717
function main(conf) {
1818
const n = +conf.requests;

benchmark/http2/write.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ const PORT = common.PORT;
66
const bench = common.createBenchmark(main, {
77
streams: [100, 200, 1000],
88
length: [64 * 1024, 128 * 1024, 256 * 1024, 1024 * 1024],
9-
}, { flags: ['--expose-http2', '--no-warnings'] });
9+
}, { flags: ['--no-warnings'] });
1010

1111
function main(conf) {
1212
const m = +conf.streams;

doc/api/cli.md

-7

doc/api/http2.md

-3

doc/node.1

-4
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

-3
Original file line numberDiff line numberDiff line change
@@ -510,9 +510,6 @@
510510

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

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

lib/internal/module.js

+1-5
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

+2-6
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;
@@ -3801,7 +3798,6 @@ static void PrintHelp() {
38013798
" --abort-on-uncaught-exception\n"
38023799
" aborting instead of exiting causes a\n"
38033800
" core file to be generated for analysis\n"
3804-
" --expose-http2 enable experimental HTTP2 support\n"
38053801
" --trace-warnings show stack traces on process warnings\n"
38063802
" --redirect-warnings=file\n"
38073803
" write warnings to file instead of\n"
@@ -3925,7 +3921,7 @@ static void CheckIfAllowedInEnv(const char* exe, bool is_env,
39253921
"--pending-deprecation",
39263922
"--no-warnings",
39273923
"--napi-modules",
3928-
"--expose-http2",
3924+
"--expose-http2", // keep as a non-op through v9.x
39293925
"--trace-warnings",
39303926
"--redirect-warnings",
39313927
"--trace-sync-io",
@@ -4127,7 +4123,7 @@ static void ParseArgs(int* argc,
41274123
config_expose_internals = true;
41284124
} else if (strcmp(arg, "--expose-http2") == 0 ||
41294125
strcmp(arg, "--expose_http2") == 0) {
4130-
config_expose_http2 = true;
4126+
// Keep as a non-op through v9.x
41314127
} else if (strcmp(arg, "-") == 0) {
41324128
break;
41334129
} else if (strcmp(arg, "--") == 0) {

src/node_config.cc

-3
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

-2
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

-1
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

-1
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-destroy-before-connect.js

-1
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-destroy-before-request.js

-1
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-destroy-goaway.js

-1
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-destroy.js

-1
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-onconnect-errors.js

-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
// Flags: --expose-http2
21
'use strict';
32

43
const {

test/parallel/test-http2-client-priority-before-connect.js

-1
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-promisify-connect.js

-1
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-request-options-errors.js

-1
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-rststream-before-connect.js

-1
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-set-priority.js

-1
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-settings-before-connect.js

-1
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-shutdown-before-connect.js

-1
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-socket-destroy.js

-1
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-stream-destroy-before-connect.js

-1
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-unescaped-path.js

-1
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-upload.js

-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
// Flags: --expose-http2
21
'use strict';
32

43
// Verifies that uploading data from a client works

test/parallel/test-http2-client-write-before-connect.js

-1
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-compat-errors.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Flags: --expose-http2 --expose-internals
1+
// Flags: --expose-internals
22
'use strict';
33

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

test/parallel/test-http2-compat-expect-continue-check.js

-1
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-compat-expect-continue.js

-1
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-compat-expect-handling.js

-1
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-compat-method-connect.js

-1
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-compat-serverrequest-end.js

-1
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-compat-serverrequest-headers.js

-1
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-compat-serverrequest-pause.js

-1
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-compat-serverrequest-pipe.js

-1
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-compat-serverrequest-settimeout.js

-1
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-compat-serverrequest-trailers.js

-1
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-compat-serverrequest.js

-1
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-compat-serverresponse-close.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Flags: --expose-http2 --expose-internals
1+
// Flags: --expose-internals
22
'use strict';
33

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

test/parallel/test-http2-compat-serverresponse-createpushresponse.js

-1
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-compat-serverresponse-destroy.js

-1
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-compat-serverresponse-drain.js

-1
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-compat-serverresponse-end.js

-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
// Flags: --expose-http2
21
'use strict';
32

43
const { mustCall, mustNotCall, hasCrypto, skip } = require('../common');

test/parallel/test-http2-compat-serverresponse-finished.js

-1
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-compat-serverresponse-flushheaders.js

-1
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-compat-serverresponse-headers.js

-1
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-compat-serverresponse-settimeout.js

-1
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-compat-serverresponse-statuscode.js

-1
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-compat-serverresponse-statusmessage-property-set.js

-1
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-compat-serverresponse-statusmessage-property.js

-1
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-compat-serverresponse-statusmessage.js

-1
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-compat-serverresponse-trailers.js

-1
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-compat-serverresponse-write-no-cb.js

-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
// Flags: --expose-http2
21
'use strict';
32

43
const { mustCall,

test/parallel/test-http2-compat-serverresponse-writehead.js

-1
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-connect-method.js

-1
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-connect.js

-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
// Flags: --expose-http2
21
'use strict';
32

43
const { mustCall, hasCrypto, skip, expectsError } = require('../common');

0 commit comments

Comments
 (0)