File tree 2 files changed +16
-1
lines changed
2 files changed +16
-1
lines changed Original file line number Diff line number Diff line change @@ -3288,14 +3288,17 @@ Node-API callbacks.
3288
3288
3289
3289
<!-- YAML
3290
3290
changes:
3291
+ - version: REPLACEME
3292
+ pr-url: https://github.com/nodejs/node/pull/00000
3293
+ description: Added support for `--pending-deprecation`.
3291
3294
- version:
3292
3295
- v19.0.0
3293
3296
- v18.13.0
3294
3297
pr-url: https://github.com/nodejs/node/pull/44919
3295
3298
description: Documentation-only deprecation.
3296
3299
-->
3297
3300
3298
- Type: Documentation-only
3301
+ Type: Documentation-only (supports [ ` --pending-deprecation ` ] [ ] )
3299
3302
3300
3303
[ ` url.parse() ` ] [ ] behavior is not standardized and prone to errors that
3301
3304
have security implications. Use the [ WHATWG URL API] [ ] instead. CVEs are not
Original file line number Diff line number Diff line change @@ -62,6 +62,8 @@ const {
62
62
formatUrl,
63
63
} = internalBinding ( 'url' ) ;
64
64
65
+ const { getOptionValue } = require ( 'internal/options' ) ;
66
+
65
67
// Original url.parse() API
66
68
67
69
function Url ( ) {
@@ -147,6 +149,16 @@ const {
147
149
} = require ( 'internal/constants' ) ;
148
150
149
151
function urlParse ( url , parseQueryString , slashesDenoteHost ) {
152
+ if ( getOptionValue ( '--pending-deprecation' ) ) {
153
+ process . emitWarning (
154
+ '`url.parse()` behavior is not standardized and prone to ' +
155
+ 'errors that have security implications. Use the WHATWG URL API ' +
156
+ 'instead. CVEs are not issued for `url.parse()` vulnerabilities.' ,
157
+ 'DeprecationWarning' ,
158
+ 'DEP0169' ,
159
+ ) ;
160
+ }
161
+
150
162
if ( url instanceof Url ) return url ;
151
163
152
164
const urlObject = new Url ( ) ;
You can’t perform that action at this time.
0 commit comments