| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent ad38be4 commit 295e766
6 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -2051,12 +2051,15 @@ expose values under these names. | |||
| 2051 | 2051 | ### DEP0109: `http`, `https`, and `tls` support for invalid URLs | |
| 2052 | 2052 | <!-- YAML | |
| 2053 | 2053 | changes: | |
| 2054 | + - version: REPLACEME | ||
| 2055 | + pr-url: https://github.com/nodejs/node/pull/36853 | ||
| 2056 | + description: End-of-Life. | ||
| 2054 | 2057 | - version: v11.0.0 | |
| 2055 | 2058 | pr-url: https://github.com/nodejs/node/pull/20270 | |
| 2056 | 2059 | description: Runtime deprecation. | |
| 2057 | 2060 | --> | |
| 2058 | 2061 | ||
| 2059 | - Type: Runtime | ||
| 2062 | + Type: End-of-Life | ||
| 2060 | 2063 | ||
| 2061 | 2064 | Some previously supported (but strictly invalid) URLs were accepted through the | |
| 2062 | 2065 | [`http.request()`][], [`http.get()`][], [`https.request()`][], | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -42,7 +42,6 @@ const { | |||
| 42 | 42 | } = primordials; | |
| 43 | 43 | ||
| 44 | 44 | const net = require('net'); | |
| 45 | - const url = require('url'); | ||
| 46 | 45 | const assert = require('internal/assert'); | |
| 47 | 46 | const { once } = require('internal/util'); | |
| 48 | 47 | const { | |
@@ -98,27 +97,12 @@ class HTTPClientAsyncResource { | |||
| 98 | 97 | } | |
| 99 | 98 | } | |
| 100 | 99 | ||
| 101 | - let urlWarningEmitted = false; | ||
| 102 | 100 | function ClientRequest(input, options, cb) { | |
| 103 | 101 | FunctionPrototypeCall(OutgoingMessage, this); | |
| 104 | 102 | ||
| 105 | 103 | if (typeof input === 'string') { | |
| 106 | 104 | const urlStr = input; | |
| 107 | - try { | ||
| 108 | - input = urlToHttpOptions(new URL(urlStr)); | ||
| 109 | - } catch (err) { | ||
| 110 | - input = url.parse(urlStr); | ||
| 111 | - if (!input.hostname) { | ||
| 112 | - throw err; | ||
| 113 | - } | ||
| 114 | - if (!urlWarningEmitted && !process.noDeprecation) { | ||
| 115 | - urlWarningEmitted = true; | ||
| 116 | - process.emitWarning( | ||
| 117 | - `The provided URL ${urlStr} is not a valid URL, and is supported ` + | ||
| 118 | - 'in the http module solely for compatibility.', | ||
| 119 | - 'DeprecationWarning', 'DEP0109'); | ||
| 120 | - } | ||
| 121 | - } | ||
| 105 | + input = urlToHttpOptions(new URL(urlStr)); | ||
| 122 | 106 | } else if (input && input[searchParamsSymbol] && | |
| 123 | 107 | input[searchParamsSymbol][searchParamsSymbol]) { | |
| 124 | 108 | // url.URL instance | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -37,7 +37,6 @@ const { | |||
| 37 | 37 | require('internal/util').assertCrypto(); | |
| 38 | 38 | ||
| 39 | 39 | const tls = require('tls'); | |
| 40 | - const url = require('url'); | ||
| 41 | 40 | const { Agent: HttpAgent } = require('_http_agent'); | |
| 42 | 41 | const { | |
| 43 | 42 | Server: HttpServer, | |
@@ -296,27 +295,12 @@ Agent.prototype._evictSession = function _evictSession(key) { | |||
| 296 | 295 | ||
| 297 | 296 | const globalAgent = new Agent(); | |
| 298 | 297 | ||
| 299 | - let urlWarningEmitted = false; | ||
| 300 | 298 | function request(...args) { | |
| 301 | 299 | let options = {}; | |
| 302 | 300 | ||
| 303 | 301 | if (typeof args[0] === 'string') { | |
| 304 | 302 | const urlStr = ArrayPrototypeShift(args); | |
| 305 | - try { | ||
| 306 | - options = urlToHttpOptions(new URL(urlStr)); | ||
| 307 | - } catch (err) { | ||
| 308 | - options = url.parse(urlStr); | ||
| 309 | - if (!options.hostname) { | ||
| 310 | - throw err; | ||
| 311 | - } | ||
| 312 | - if (!urlWarningEmitted && !process.noDeprecation) { | ||
| 313 | - urlWarningEmitted = true; | ||
| 314 | - process.emitWarning( | ||
| 315 | - `The provided URL ${urlStr} is not a valid URL, and is supported ` + | ||
| 316 | - 'in the https module solely for compatibility.', | ||
| 317 | - 'DeprecationWarning', 'DEP0109'); | ||
| 318 | - } | ||
| 319 | - } | ||
| 303 | + options = urlToHttpOptions(new URL(urlStr)); | ||
| 320 | 304 | } else if (args[0] && args[0][searchParamsSymbol] && | |
| 321 | 305 | args[0][searchParamsSymbol][searchParamsSymbol]) { | |
| 322 | 306 | // url.URL instance | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -55,7 +55,6 @@ const { isArrayBufferView } = require('internal/util/types'); | |||
| 55 | 55 | ||
| 56 | 56 | const net = require('net'); | |
| 57 | 57 | const { getOptionValue } = require('internal/options'); | |
| 58 | - const url = require('url'); | ||
| 59 | 58 | const { getRootCertificates, getSSLCiphers } = internalBinding('crypto'); | |
| 60 | 59 | const { Buffer } = require('buffer'); | |
| 61 | 60 | const EventEmitter = require('events'); | |
@@ -230,7 +229,6 @@ function check(hostParts, pattern, wildcards) { | |||
| 230 | 229 | return true; | |
| 231 | 230 | } | |
| 232 | 231 | ||
| 233 | - let urlWarningEmitted = false; | ||
| 234 | 232 | exports.checkServerIdentity = function checkServerIdentity(hostname, cert) { | |
| 235 | 233 | const subject = cert.subject; | |
| 236 | 234 | const altNames = cert.subjectaltname; | |
@@ -246,21 +244,7 @@ exports.checkServerIdentity = function checkServerIdentity(hostname, cert) { | |||
| 246 | 244 | if (StringPrototypeStartsWith(name, 'DNS:')) { | |
| 247 | 245 | ArrayPrototypePush(dnsNames, StringPrototypeSlice(name, 4)); | |
| 248 | 246 | } else if (StringPrototypeStartsWith(name, 'URI:')) { | |
| 249 | - let uri; | ||
| 250 | - try { | ||
| 251 | - uri = new URL(StringPrototypeSlice(name, 4)); | ||
| 252 | - } catch { | ||
| 253 | - const slicedName = StringPrototypeSlice(name, 4); | ||
| 254 | - uri = url.parse(slicedName); | ||
| 255 | - if (!urlWarningEmitted && !process.noDeprecation) { | ||
| 256 | - urlWarningEmitted = true; | ||
| 257 | - process.emitWarning( | ||
| 258 | - `The URI ${slicedName} found in cert.subjectaltname ` + | ||
| 259 | - 'is not a valid URI, and is supported in the tls module ' + | ||
| 260 | - 'solely for compatibility.', | ||
| 261 | - 'DeprecationWarning', 'DEP0109'); | ||
| 262 | - } | ||
| 263 | - } | ||
| 247 | + const uri = new URL(StringPrototypeSlice(name, 4)); | ||
| 264 | 248 | ||
| 265 | 249 | // TODO(bnoordhuis) Also use scheme. | |
| 266 | 250 | ArrayPrototypePush(uriNames, uri.hostname); | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -30,13 +30,6 @@ const util = require('util'); | |||
| 30 | 30 | ||
| 31 | 31 | const tls = require('tls'); | |
| 32 | 32 | ||
| 33 | - common.expectWarning('DeprecationWarning', [ | ||
| 34 | - ['The URI http://[a.b.a.com]/ found in cert.subjectaltname ' + | ||
| 35 | - 'is not a valid URI, and is supported in the tls module ' + | ||
| 36 | - 'solely for compatibility.', | ||
| 37 | - 'DEP0109'], | ||
| 38 | - ]); | ||
| 39 | - | ||
| 40 | 33 | const tests = [ | |
| 41 | 34 | // False-y values. | |
| 42 | 35 | { | |
@@ -282,13 +275,6 @@ const tests = [ | |||
| 282 | 275 | error: 'Host: a.b.a.com. is not in the cert\'s altnames: ' + | |
| 283 | 276 | 'URI:http://*.b.a.com/' | |
| 284 | 277 | }, | |
| 285 | - // Invalid URI | ||
| 286 | - { | ||
| 287 | - host: 'a.b.a.com', cert: { | ||
| 288 | - subjectaltname: 'URI:http://[a.b.a.com]/', | ||
| 289 | - subject: {} | ||
| 290 | - } | ||
| 291 | - }, | ||
| 292 | 278 | // IP addresses | |
| 293 | 279 | { | |
| 294 | 280 | host: 'a.b.a.com', cert: { | |
| Back | FazBrowse Home | New Git URL |
0 commit comments