@@ -246,8 +246,8 @@ std::string config_warning_file; // NOLINT(runtime/string)
246
246
// that is used by lib/internal/bootstrap_node.js
247
247
bool config_expose_internals = false ;
248
248
249
- // Set in node.cc by ParseArgs when --expose-http2 is used.
250
- bool config_expose_http2 = false ;
249
+ // Set to false in node.cc when NODE_NO_HTTP2=1 is used.
250
+ bool config_expose_http2 = true ;
251
251
252
252
bool v8_initialized = false ;
253
253
@@ -3830,7 +3830,6 @@ static void PrintHelp() {
3830
3830
" --abort-on-uncaught-exception\n "
3831
3831
" aborting instead of exiting causes a\n "
3832
3832
" core file to be generated for analysis\n "
3833
- " --expose-http2 enable experimental HTTP2 support\n "
3834
3833
" --trace-warnings show stack traces on process warnings\n "
3835
3834
" --redirect-warnings=file\n "
3836
3835
" write warnings to file instead of\n "
@@ -3894,7 +3893,8 @@ static void PrintHelp() {
3894
3893
#endif
3895
3894
#endif
3896
3895
" NODE_NO_WARNINGS set to 1 to silence process warnings\n "
3897
- #if !defined(NODE_WITHOUT_NODE_OPTIONS)
3896
+ " NODE_NO_HTTP2 set to 1 to suppress the http2 module\n "
3897
+ #if !defined(NODE_WITHOUT_NODE_OPTIONS)
3898
3898
" NODE_OPTIONS set CLI options in the environment\n "
3899
3899
" via a space-separated list\n "
3900
3900
#endif
@@ -4173,7 +4173,7 @@ static void ParseArgs(int* argc,
4173
4173
config_expose_internals = true ;
4174
4174
} else if (strcmp (arg, " --expose-http2" ) == 0 ||
4175
4175
strcmp (arg, " --expose_http2" ) == 0 ) {
4176
- config_expose_http2 = true ;
4176
+ // Intentional non-op
4177
4177
} else if (strcmp (arg, " -" ) == 0 ) {
4178
4178
break ;
4179
4179
} else if (strcmp (arg, " --" ) == 0 ) {
@@ -4550,6 +4550,12 @@ void Init(int* argc,
4550
4550
SafeGetenv (" NODE_PENDING_DEPRECATION" , &text) && text[0 ] == ' 1' ;
4551
4551
}
4552
4552
4553
+ {
4554
+ std::string text;
4555
+ config_expose_http2 =
4556
+ !(SafeGetenv (" NODE_NO_HTTP2" , &text) && text[0 ] == ' 1' );
4557
+ }
4558
+
4553
4559
// Allow for environment set preserving symlinks.
4554
4560
{
4555
4561
std::string text;
0 commit comments