Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

http2: make --expose-http2 flag a non-op #15535

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 0 additions & 7 deletions doc/api/cli.md
Original file line number Diff line number Diff line change
Expand Up @@ -171,13 +171,6 @@ added: v6.0.0

Silence all process warnings (including deprecations).

### `--expose-http2`
<!-- YAML
added: v8.4.0
-->

Enable the experimental `'http2'` module.

### `--abort-on-uncaught-exception`
<!-- YAML
added: v0.10
Expand Down
3 changes: 0 additions & 3 deletions doc/api/http2.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,6 @@ can be accessed using:
const http2 = require('http2');
```

*Note*: Node.js must be launched with the `--expose-http2` command line flag
in order to use the `'http2'` module.

## Core API

The Core API provides a low-level interface designed specifically around
Expand Down
4 changes: 0 additions & 4 deletions doc/node.1
Original file line number Diff line number Diff line change
Expand Up @@ -130,10 +130,6 @@ Emit pending deprecation warnings.
.BR \-\-no\-warnings
Silence all process warnings (including deprecations).

.TP
.BR \-\-expose\-http2
Enable the experimental `'http2'` module.

.TP
.BR \-\-napi\-modules
Enable loading native modules compiled with the ABI-stable Node.js API (N-API)
Expand Down
3 changes: 0 additions & 3 deletions lib/internal/bootstrap_node.js
Original file line number Diff line number Diff line change
Expand Up @@ -509,9 +509,6 @@

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

if (!config.exposeHTTP2)
delete NativeModule._source.http2;

NativeModule.require = function(id) {
if (id === 'native_module') {
return NativeModule;
Expand Down
6 changes: 1 addition & 5 deletions lib/internal/module.js
Original file line number Diff line number Diff line change
Expand Up @@ -78,15 +78,11 @@ function stripShebang(content) {

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

const { exposeHTTP2 } = process.binding('config');
if (exposeHTTP2)
builtinLibs.push('http2');

function addBuiltinLibsToObject(object) {
// Make built-in modules available directly (loaded lazily).
builtinLibs.forEach((name) => {
Expand Down
8 changes: 2 additions & 6 deletions src/node.cc
Original file line number Diff line number Diff line change
Expand Up @@ -244,9 +244,6 @@ std::string config_warning_file; // NOLINT(runtime/string)
// that is used by lib/internal/bootstrap_node.js
bool config_expose_internals = false;

// Set in node.cc by ParseArgs when --expose-http2 is used.
bool config_expose_http2 = false;

bool v8_initialized = false;

bool linux_at_secure = false;
Expand Down Expand Up @@ -3792,7 +3789,6 @@ static void PrintHelp() {
" --abort-on-uncaught-exception\n"
" aborting instead of exiting causes a\n"
" core file to be generated for analysis\n"
" --expose-http2 enable experimental HTTP2 support\n"
" --trace-warnings show stack traces on process warnings\n"
" --redirect-warnings=file\n"
" write warnings to file instead of\n"
Expand Down Expand Up @@ -3915,7 +3911,7 @@ static void CheckIfAllowedInEnv(const char* exe, bool is_env,
"--throw-deprecation",
"--no-warnings",
"--napi-modules",
"--expose-http2",
"--expose-http2", // keep as a non-op through v9.x
"--trace-warnings",
"--redirect-warnings",
"--trace-sync-io",
Expand Down Expand Up @@ -4117,7 +4113,7 @@ static void ParseArgs(int* argc,
config_expose_internals = true;
} else if (strcmp(arg, "--expose-http2") == 0 ||
strcmp(arg, "--expose_http2") == 0) {
config_expose_http2 = true;
// Keep as a non-op through v9.x
} else if (strcmp(arg, "-") == 0) {
break;
} else if (strcmp(arg, "--") == 0) {
Expand Down
3 changes: 0 additions & 3 deletions src/node_config.cc
Original file line number Diff line number Diff line change
Expand Up @@ -74,9 +74,6 @@ static void InitConfig(Local<Object> target,
if (config_expose_internals)
READONLY_BOOLEAN_PROPERTY("exposeInternals");

if (config_expose_http2)
READONLY_BOOLEAN_PROPERTY("exposeHTTP2");

READONLY_PROPERTY(target,
"bits",
Number::New(env->isolate(), 8 * sizeof(intptr_t)));
Expand Down
2 changes: 0 additions & 2 deletions src/node_internals.h
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,6 @@ extern std::string openssl_config;
// that is used by lib/module.js
extern bool config_preserve_symlinks;

// Set in node.cc by ParseArgs when --expose-http2 is used.
extern bool config_expose_http2;
// Set in node.cc by ParseArgs when --experimental-modules is used.
// Used in node_config.cc to set a constant on process.binding('config')
// that is used by lib/module.js
Expand Down
1 change: 0 additions & 1 deletion test/parallel/test-http2-binding.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
// Flags: --expose-http2
'use strict';

const common = require('../common');
Expand Down
1 change: 0 additions & 1 deletion test/parallel/test-http2-client-data-end.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
// Flags: --expose-http2
'use strict';

const common = require('../common');
Expand Down
1 change: 0 additions & 1 deletion test/parallel/test-http2-client-destroy-before-connect.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
// Flags: --expose-http2
'use strict';

const common = require('../common');
Expand Down
1 change: 0 additions & 1 deletion test/parallel/test-http2-client-destroy-before-request.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
// Flags: --expose-http2
'use strict';

const common = require('../common');
Expand Down
1 change: 0 additions & 1 deletion test/parallel/test-http2-client-destroy-goaway.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
// Flags: --expose-http2
'use strict';

const common = require('../common');
Expand Down
1 change: 0 additions & 1 deletion test/parallel/test-http2-client-destroy.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
// Flags: --expose-http2
'use strict';

const common = require('../common');
Expand Down
1 change: 0 additions & 1 deletion test/parallel/test-http2-client-onconnect-errors.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
// Flags: --expose-http2
'use strict';

const {
Expand Down
1 change: 0 additions & 1 deletion test/parallel/test-http2-client-priority-before-connect.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
// Flags: --expose-http2
'use strict';

const common = require('../common');
Expand Down
1 change: 0 additions & 1 deletion test/parallel/test-http2-client-promisify-connect.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
// Flags: --expose-http2
'use strict';

const common = require('../common');
Expand Down
1 change: 0 additions & 1 deletion test/parallel/test-http2-client-request-options-errors.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
// Flags: --expose-http2
'use strict';

const common = require('../common');
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
// Flags: --expose-http2
'use strict';

const common = require('../common');
Expand Down
1 change: 0 additions & 1 deletion test/parallel/test-http2-client-set-priority.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
// Flags: --expose-http2
'use strict';

const common = require('../common');
Expand Down
1 change: 0 additions & 1 deletion test/parallel/test-http2-client-settings-before-connect.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
// Flags: --expose-http2
'use strict';

const common = require('../common');
Expand Down
1 change: 0 additions & 1 deletion test/parallel/test-http2-client-shutdown-before-connect.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
// Flags: --expose-http2
'use strict';

const common = require('../common');
Expand Down
1 change: 0 additions & 1 deletion test/parallel/test-http2-client-socket-destroy.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
// Flags: --expose-http2
'use strict';

const common = require('../common');
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
// Flags: --expose-http2
'use strict';

const common = require('../common');
Expand Down
1 change: 0 additions & 1 deletion test/parallel/test-http2-client-unescaped-path.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
// Flags: --expose-http2
'use strict';

const common = require('../common');
Expand Down
1 change: 0 additions & 1 deletion test/parallel/test-http2-client-upload.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
// Flags: --expose-http2
'use strict';

// Verifies that uploading data from a client works
Expand Down
1 change: 0 additions & 1 deletion test/parallel/test-http2-client-write-before-connect.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
// Flags: --expose-http2
'use strict';

const common = require('../common');
Expand Down
2 changes: 1 addition & 1 deletion test/parallel/test-http2-compat-errors.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Flags: --expose-http2 --expose-internals
// Flags: --expose-internals
'use strict';

const common = require('../common');
Expand Down
1 change: 0 additions & 1 deletion test/parallel/test-http2-compat-expect-continue-check.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
// Flags: --expose-http2
'use strict';

const common = require('../common');
Expand Down
1 change: 0 additions & 1 deletion test/parallel/test-http2-compat-expect-continue.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
// Flags: --expose-http2
'use strict';

const common = require('../common');
Expand Down
1 change: 0 additions & 1 deletion test/parallel/test-http2-compat-expect-handling.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
// Flags: --expose-http2
'use strict';

const common = require('../common');
Expand Down
1 change: 0 additions & 1 deletion test/parallel/test-http2-compat-method-connect.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
// Flags: --expose-http2
'use strict';

const common = require('../common');
Expand Down
1 change: 0 additions & 1 deletion test/parallel/test-http2-compat-serverrequest-end.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
// Flags: --expose-http2
'use strict';

const common = require('../common');
Expand Down
1 change: 0 additions & 1 deletion test/parallel/test-http2-compat-serverrequest-headers.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
// Flags: --expose-http2
'use strict';

const common = require('../common');
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
// Flags: --expose-http2
'use strict';

const common = require('../common');
Expand Down
1 change: 0 additions & 1 deletion test/parallel/test-http2-compat-serverrequest-trailers.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
// Flags: --expose-http2
'use strict';

const common = require('../common');
Expand Down
1 change: 0 additions & 1 deletion test/parallel/test-http2-compat-serverrequest.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
// Flags: --expose-http2
'use strict';

const common = require('../common');
Expand Down
2 changes: 1 addition & 1 deletion test/parallel/test-http2-compat-serverresponse-close.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Flags: --expose-http2 --expose-internals
// Flags: --expose-internals
'use strict';

const common = require('../common');
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
// Flags: --expose-http2
'use strict';

const common = require('../common');
Expand Down
1 change: 0 additions & 1 deletion test/parallel/test-http2-compat-serverresponse-destroy.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
// Flags: --expose-http2
'use strict';

const common = require('../common');
Expand Down
1 change: 0 additions & 1 deletion test/parallel/test-http2-compat-serverresponse-end.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
// Flags: --expose-http2
'use strict';

const { mustCall, mustNotCall, hasCrypto, skip } = require('../common');
Expand Down
1 change: 0 additions & 1 deletion test/parallel/test-http2-compat-serverresponse-finished.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
// Flags: --expose-http2
'use strict';

const common = require('../common');
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
// Flags: --expose-http2
'use strict';

const common = require('../common');
Expand Down
1 change: 0 additions & 1 deletion test/parallel/test-http2-compat-serverresponse-headers.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
// Flags: --expose-http2
'use strict';

const common = require('../common');
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
// Flags: --expose-http2
'use strict';

const common = require('../common');
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
// Flags: --expose-http2
'use strict';

const common = require('../common');
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
// Flags: --expose-http2
'use strict';

const common = require('../common');
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
// Flags: --expose-http2
'use strict';

const common = require('../common');
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
// Flags: --expose-http2
'use strict';

const common = require('../common');
Expand Down
1 change: 0 additions & 1 deletion test/parallel/test-http2-compat-serverresponse-trailers.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
// Flags: --expose-http2
'use strict';

const common = require('../common');
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
// Flags: --expose-http2
'use strict';

const { mustCall,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
// Flags: --expose-http2
'use strict';

const common = require('../common');
Expand Down
1 change: 0 additions & 1 deletion test/parallel/test-http2-connect-method.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
// Flags: --expose-http2
'use strict';

const common = require('../common');
Expand Down
1 change: 0 additions & 1 deletion test/parallel/test-http2-connect.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
// Flags: --expose-http2
'use strict';

const { mustCall, hasCrypto, skip, expectsError } = require('../common');
Expand Down
1 change: 0 additions & 1 deletion test/parallel/test-http2-cookies.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
// Flags: --expose-http2
'use strict';

const common = require('../common');
Expand Down
1 change: 0 additions & 1 deletion test/parallel/test-http2-create-client-connect.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
// Flags: --expose-http2
'use strict';

// Tests http2.connect()
Expand Down
1 change: 0 additions & 1 deletion test/parallel/test-http2-create-client-secure-session.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
// Flags: --expose-http2
'use strict';

const common = require('../common');
Expand Down
1 change: 0 additions & 1 deletion test/parallel/test-http2-create-client-session.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
// Flags: --expose-http2
'use strict';

const common = require('../common');
Expand Down
1 change: 0 additions & 1 deletion test/parallel/test-http2-createsecureserver-nooptions.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
// Flags: --expose-http2
'use strict';

const common = require('../common');
Expand Down
1 change: 0 additions & 1 deletion test/parallel/test-http2-createwritereq.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
// Flags: --expose-http2
'use strict';

const common = require('../common');
Expand Down
1 change: 0 additions & 1 deletion test/parallel/test-http2-date-header.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
// Flags: --expose-http2
'use strict';

const common = require('../common');
Expand Down
1 change: 0 additions & 1 deletion test/parallel/test-http2-dont-override.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
// Flags: --expose-http2
'use strict';

const common = require('../common');
Expand Down
1 change: 0 additions & 1 deletion test/parallel/test-http2-getpackedsettings.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
// Flags: --expose-http2
'use strict';

const common = require('../common');
Expand Down
1 change: 0 additions & 1 deletion test/parallel/test-http2-goaway-opaquedata.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
// Flags: --expose-http2
'use strict';

const common = require('../common');
Expand Down
Loading