Skip to content

Commit 9e7678d

Browse files
committed
Remove deprecated use of url.parse
`url.parse` is deprecated and should be replaced by the WHATWG URL API, so this makes that change. The `protocol` and `host` properties are unchanged, so no other changes are needed.
1 parent a4f1f49 commit 9e7678d

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

extensions/ql-vscode/src/codeql-cli/distribution.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { pathExists, mkdtemp, createWriteStream, remove } from "fs-extra";
33
import { tmpdir } from "os";
44
import { delimiter, dirname, join } from "path";
55
import * as semver from "semver";
6-
import { parse } from "url";
6+
import { URL } from "url";
77
import { ExtensionContext, Event } from "vscode";
88
import { DistributionConfig } from "../config";
99
import {
@@ -670,7 +670,7 @@ export class ReleasesApiConsumer {
670670
redirectUrl &&
671671
redirectCount < ReleasesApiConsumer._maxRedirects
672672
) {
673-
const parsedRedirectUrl = parse(redirectUrl);
673+
const parsedRedirectUrl = new URL(redirectUrl);
674674
if (parsedRedirectUrl.protocol !== "https:") {
675675
throw new Error("Encountered a non-https redirect, rejecting");
676676
}

0 commit comments

Comments
 (0)