Skip to content

Commit a79b71c

Browse files
Switch ALLOW_HTTP_SETTING for allowHttp()
1 parent f0318b0 commit a79b71c

2 files changed

Lines changed: 3 additions & 6 deletions

File tree

extensions/ql-vscode/src/config.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -649,10 +649,7 @@ export function isCodespacesTemplate() {
649649

650650
const DATABASE_DOWNLOAD_SETTING = new Setting("databaseDownload", ROOT_SETTING);
651651

652-
export const ALLOW_HTTP_SETTING = new Setting(
653-
"allowHttp",
654-
DATABASE_DOWNLOAD_SETTING,
655-
);
652+
const ALLOW_HTTP_SETTING = new Setting("allowHttp", DATABASE_DOWNLOAD_SETTING);
656653

657654
export function allowHttp(): boolean {
658655
return ALLOW_HTTP_SETTING.getValue<boolean>() || false;

extensions/ql-vscode/src/databases/database-fetcher.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ import {
3030
} from "../common/github-url-identifier-helper";
3131
import { Credentials } from "../common/authentication";
3232
import { AppCommandManager } from "../common/commands";
33-
import { ALLOW_HTTP_SETTING } from "../config";
33+
import { allowHttp } from "../config";
3434
import { showAndLogInformationMessage } from "../common/logging";
3535

3636
/**
@@ -371,7 +371,7 @@ function validateUrl(databaseUrl: string) {
371371
throw new Error(`Invalid url: ${databaseUrl}`);
372372
}
373373

374-
if (!ALLOW_HTTP_SETTING.getValue() && uri.scheme !== "https") {
374+
if (!allowHttp() && uri.scheme !== "https") {
375375
throw new Error("Must use https for downloading a database.");
376376
}
377377
}

0 commit comments

Comments
 (0)