From 38c63db1d188f8c1f640a2e7086eb475bbcadbbf Mon Sep 17 00:00:00 2001 From: muzea Date: Thu, 26 Dec 2024 17:33:30 +0800 Subject: [PATCH] fix: https connect error --- example-web/config.ts | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/example-web/config.ts b/example-web/config.ts index 2333d39..a1d412c 100644 --- a/example-web/config.ts +++ b/example-web/config.ts @@ -22,8 +22,13 @@ function getCurrentPort() { return window.location.protocol === 'https:' ? 443 : 80; } +function getSecured() { + return window.location.protocol === 'https:' ? true : false; +} + const host = window.location.hostname; const port = getCurrentPort(); +const secured = getSecured(); export const createUserConfigForPython = (workspaceRoot: string, code: string, codeUri: string): UserConfig => { return { @@ -38,7 +43,7 @@ export const createUserConfigForPython = (workspaceRoot: string, code: string, c extraParams: { authorization: 'UserAuth', }, - secured: false, + secured: secured, startOptions: { onCall: (languageClient?: MonacoLanguageClient) => { setTimeout(() => { @@ -107,7 +112,7 @@ export const createUserConfigForCpp = (workspaceRoot: string, code: string, code extraParams: { authorization: 'UserAuth', }, - secured: false, + secured: secured, }, clientOptions: { documentSelector: ['cpp'], @@ -187,7 +192,7 @@ export const createUserConfigForJava = (workspaceRoot: string, code: string, cod extraParams: { authorization: 'UserAuth', }, - secured: false, + secured: secured, }, clientOptions: { documentSelector: ['java'],