Use URL API (#11316)
Some checks are pending
Node.js CI / build (18.x) (push) Waiting to run

* Fix typo

* Remove unnessecary file

* Use URL API

Clears this warning

```
(node:44968) [DEP0169] DeprecationWarning: `url.parse()`
  behavior is not standardized and prone to errors that have
  security implications. Use the WHATWG URL API instead. CVEs are
  not issued for `url.parse()` vulnerabilities.
```

---------

Co-authored-by: Mia <49593536+mia-pi-git@users.noreply.github.com>
Co-authored-by: HoeenHero <HoeenCoder@users.noreply.github.com>
This commit is contained in:
Sergio Garcia 2025-07-31 17:04:20 +02:00 committed by GitHub
parent c135ecdce8
commit 005d98993f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -7,7 +7,6 @@
import * as https from 'https';
import * as http from 'http';
import * as url from 'url';
import * as Streams from './streams';
declare const Config: any;
@ -76,7 +75,7 @@ export class NetStream extends Streams.ReadWriteStream {
}
}
const protocol = url.parse(this.uri).protocol;
const protocol = new URL(this.uri).protocol;
const net = protocol === 'https:' ? https : http;
let resolveResponse: ((value: http.IncomingMessage | null) => void) | null;