File tree Expand file tree Collapse file tree 3 files changed +8
-4
lines changed
Expand file tree Collapse file tree 3 files changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -3441,6 +3441,10 @@ Node-API callbacks.
34413441
34423442<!-- YAML
34433443changes:
3444+ - version:
3445+ - REPLACEME
3446+ pr-url: https://github.com/nodejs/node/pull/55017
3447+ description: Application deprecation.
34443448 - version:
34453449 - v19.9.0
34463450 - v18.17.0
@@ -3453,7 +3457,7 @@ changes:
34533457 description: Documentation-only deprecation.
34543458-->
34553459
3456- Type: Documentation-only (supports [ ` --pending-deprecation ` ] [ ] )
3460+ Type: Application (non- ` node_modules ` code only )
34573461
34583462[ ` url.parse() ` ] [ ] behavior is not standardized and prone to errors that
34593463have security implications. Use the [ WHATWG URL API] [ ] instead. CVEs are not
Original file line number Diff line number Diff line change @@ -46,6 +46,7 @@ const {
4646// This ensures setURLConstructor() is called before the native
4747// URL::ToObject() method is used.
4848const { spliceOne } = require ( 'internal/util' ) ;
49+ const { isInsideNodeModules } = internalBinding ( 'util' ) ;
4950
5051// WHATWG URL implementation provided by internal/url
5152const {
@@ -63,8 +64,6 @@ const {
6364
6465const bindingUrl = internalBinding ( 'url' ) ;
6566
66- const { getOptionValue } = require ( 'internal/options' ) ;
67-
6867// Original url.parse() API
6968
7069function Url ( ) {
@@ -125,7 +124,7 @@ const {
125124let urlParseWarned = false ;
126125
127126function urlParse ( url , parseQueryString , slashesDenoteHost ) {
128- if ( ! urlParseWarned && getOptionValue ( '--pending-deprecation' ) ) {
127+ if ( ! urlParseWarned && ! isInsideNodeModules ( ) ) {
129128 urlParseWarned = true ;
130129 process . emitWarning (
131130 '`url.parse()` behavior is not standardized and prone to ' +
Original file line number Diff line number Diff line change @@ -45,4 +45,5 @@ export interface UtilBinding {
4545 guessHandleType ( fd : number ) : 'TCP' | 'TTY' | 'UDP' | 'FILE' | 'PIPE' | 'UNKNOWN' ;
4646 parseEnv ( content : string ) : Record < string , string > ;
4747 styleText ( format : Array < string > | string , text : string ) : string ;
48+ isInsideNodeModules ( ) : boolean ;
4849}
You can’t perform that action at this time.
0 commit comments