| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 6cef0e3 commit a0b6104
4 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -383,6 +383,10 @@ Specify the file name of the heap profile generated by `--heap-prof`. | |||
| 383 | 383 | ### `--http-parser=library` | |
| 384 | 384 | <!-- YAML | |
| 385 | 385 | added: v11.4.0 | |
| 386 | + changes: | ||
| 387 | + - version: REPLACEME | ||
| 388 | + pr-url: https://github.com/nodejs/node/pull/37603 | ||
| 389 | + description: The legacy HTTP parser will emit a deprecation warning. | ||
| 386 | 390 | --> | |
| 387 | 391 | ||
| 388 | 392 | Chooses an HTTP parser library. Available values are: | |
@@ -392,6 +396,8 @@ Chooses an HTTP parser library. Available values are: | |||
| 392 | 396 | ||
| 393 | 397 | The default is `llhttp`, unless otherwise specified when building Node.js. | |
| 394 | 398 | ||
| 399 | + The `legacy` HTTP parser is deprecated and will emit a deprecation warning. | ||
| 400 | + | ||
| 395 | 401 | This flag exists to aid in experimentation with the internal implementation of | |
| 396 | 402 | the Node.js http parser. | |
| 397 | 403 | This flag is likely to become a no-op and removed at some point in the future. | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -2469,12 +2469,15 @@ Module.createRequireFromPath() is deprecated. Please use [`module.createRequire( | |||
| 2469 | 2469 | ### DEP0131: Legacy HTTP parser | |
| 2470 | 2470 | <!-- YAML | |
| 2471 | 2471 | changes: | |
| 2472 | + - version: REPLACEME | ||
| 2473 | + pr-url: https://github.com/nodejs/node/pull/37603 | ||
| 2474 | + description: Runtime deprecation. | ||
| 2472 | 2475 | - version: v12.3.0 | |
| 2473 | 2476 | pr-url: https://github.com/nodejs/node/pull/27498 | |
| 2474 | 2477 | description: Documentation-only. | |
| 2475 | 2478 | --> | |
| 2476 | 2479 | ||
| 2477 | - Type: Documentation-only | ||
| 2480 | + Type: Runtime | ||
| 2478 | 2481 | ||
| 2479 | 2482 | The legacy HTTP parser, used by default in versions of Node.js prior to 12.0.0, | |
| 2480 | 2483 | is deprecated. This deprecation applies to users of the | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -26,6 +26,9 @@ | |||
| 26 | 26 | ||
| 27 | 27 | #include "node.h" | |
| 28 | 28 | #include "node_buffer.h" | |
| 29 | + #ifndef NODE_EXPERIMENTAL_HTTP | ||
| 30 | + #include "node_process.h" | ||
| 31 | + #endif /* NODE_EXPERIMENTAL_HTTP */ | ||
| 29 | 32 | #include "util.h" | |
| 30 | 33 | ||
| 31 | 34 | #include "async_wrap-inl.h" | |
@@ -1021,6 +1024,10 @@ void InitializeHttpParser(Local<Object> target, | |||
| 1021 | 1024 | #ifndef NODE_EXPERIMENTAL_HTTP | |
| 1022 | 1025 | static uv_once_t init_once = UV_ONCE_INIT; | |
| 1023 | 1026 | uv_once(&init_once, InitMaxHttpHeaderSizeOnce); | |
| 1027 | + ProcessEmitDeprecationWarning( | ||
| 1028 | + env, | ||
| 1029 | + "The legacy HTTP parser is deprecated.", | ||
| 1030 | + "DEP0131").IsNothing(); | ||
| 1024 | 1031 | #endif /* NODE_EXPERIMENTAL_HTTP */ | |
| 1025 | 1032 | } | |
| 1026 | 1033 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -0,0 +1,11 @@ | |||
| 1 | + 'use strict'; | ||
| 2 | + const common = require('../common'); | ||
| 3 | + | ||
| 4 | + // Flags: --http-parser=legacy | ||
| 5 | + require('http'); | ||
| 6 | + | ||
| 7 | + common.expectWarning({ | ||
| 8 | + DeprecationWarning: | ||
| 9 | + ['The legacy HTTP parser is deprecated.', | ||
| 10 | + 'DEP0131'] | ||
| 11 | + }); | ||
| Back | FazBrowse Home | New Git URL |
0 commit comments