diff --git a/extensions/ql-vscode/src/config.ts b/extensions/ql-vscode/src/config.ts index bafc93bb5..dd2e813d3 100644 --- a/extensions/ql-vscode/src/config.ts +++ b/extensions/ql-vscode/src/config.ts @@ -649,10 +649,7 @@ export function isCodespacesTemplate() { const DATABASE_DOWNLOAD_SETTING = new Setting("databaseDownload", ROOT_SETTING); -export const ALLOW_HTTP_SETTING = new Setting( - "allowHttp", - DATABASE_DOWNLOAD_SETTING, -); +const ALLOW_HTTP_SETTING = new Setting("allowHttp", DATABASE_DOWNLOAD_SETTING); export function allowHttp(): boolean { return ALLOW_HTTP_SETTING.getValue() || false; diff --git a/extensions/ql-vscode/src/databases/database-fetcher.ts b/extensions/ql-vscode/src/databases/database-fetcher.ts index 51a9541dd..2d08ab987 100644 --- a/extensions/ql-vscode/src/databases/database-fetcher.ts +++ b/extensions/ql-vscode/src/databases/database-fetcher.ts @@ -30,7 +30,7 @@ import { } from "../common/github-url-identifier-helper"; import { Credentials } from "../common/authentication"; import { AppCommandManager } from "../common/commands"; -import { ALLOW_HTTP_SETTING } from "../config"; +import { allowHttp } from "../config"; import { showAndLogInformationMessage } from "../common/logging"; /** @@ -371,7 +371,7 @@ function validateUrl(databaseUrl: string) { throw new Error(`Invalid url: ${databaseUrl}`); } - if (!ALLOW_HTTP_SETTING.getValue() && uri.scheme !== "https") { + if (!allowHttp() && uri.scheme !== "https") { throw new Error("Must use https for downloading a database."); } }