mirror of
https://github.com/smogon/pokemon-showdown.git
synced 2026-03-21 17:25:10 -05:00
Use URL API (#11316)
Some checks are pending
Node.js CI / build (18.x) (push) Waiting to run
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:
parent
c135ecdce8
commit
005d98993f
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user