@@ -45,7 +45,7 @@ const {
45
45
46
46
// This ensures setURLConstructor() is called before the native
47
47
// URL::ToObject() method is used.
48
- const { spliceOne } = require ( 'internal/util' ) ;
48
+ const { spliceOne, deprecate } = require ( 'internal/util' ) ;
49
49
50
50
// WHATWG URL implementation provided by internal/url
51
51
const {
@@ -63,8 +63,6 @@ const {
63
63
64
64
const bindingUrl = internalBinding ( 'url' ) ;
65
65
66
- const { getOptionValue } = require ( 'internal/options' ) ;
67
-
68
66
// Original url.parse() API
69
67
70
68
function Url ( ) {
@@ -122,20 +120,7 @@ const {
122
120
CHAR_COLON ,
123
121
} = require ( 'internal/constants' ) ;
124
122
125
- let urlParseWarned = false ;
126
-
127
123
function urlParse ( url , parseQueryString , slashesDenoteHost ) {
128
- if ( ! urlParseWarned && getOptionValue ( '--pending-deprecation' ) ) {
129
- urlParseWarned = true ;
130
- process . emitWarning (
131
- '`url.parse()` behavior is not standardized and prone to ' +
132
- 'errors that have security implications. Use the WHATWG URL API ' +
133
- 'instead. CVEs are not issued for `url.parse()` vulnerabilities.' ,
134
- 'DeprecationWarning' ,
135
- 'DEP0169' ,
136
- ) ;
137
- }
138
-
139
124
if ( url instanceof Url ) return url ;
140
125
141
126
const urlObject = new Url ( ) ;
@@ -1023,7 +1008,11 @@ function pathToFileURL(path, options) {
1023
1008
module . exports = {
1024
1009
// Original API
1025
1010
Url,
1026
- parse : urlParse ,
1011
+ parse : deprecate (
1012
+ urlParse ,
1013
+ 'url.parse() is deprecated and the behavior is prone to ' +
1014
+ 'errors that have security implications. Use new URL() instead.' ,
1015
+ 'DEP0169' ) ,
1027
1016
resolve : urlResolve ,
1028
1017
resolveObject : urlResolveObject ,
1029
1018
format : urlFormat ,
0 commit comments