From b565a911941c6afcb161755ce2589da6d44fb8ec Mon Sep 17 00:00:00 2001 From: Tom Spielvogel <35257265+IDLe-Engineering@users.noreply.github.com> Date: Wed, 16 Oct 2024 10:56:46 +0200 Subject: [PATCH] Connect-src needs hold the entire path for chat completions for OpenAICompatible Simply using the enpoint will trigger a Content-Security-Policy error in vscode when trying to send messages to the LLM --- extensions/void/src/SidebarWebviewProvider.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/extensions/void/src/SidebarWebviewProvider.ts b/extensions/void/src/SidebarWebviewProvider.ts index a750a21c..a6cdf85c 100644 --- a/extensions/void/src/SidebarWebviewProvider.ts +++ b/extensions/void/src/SidebarWebviewProvider.ts @@ -55,7 +55,7 @@ export class SidebarWebviewProvider implements vscode.WebviewViewProvider { const openAICompatibleEndpoint: string | undefined = vscode.workspace.getConfiguration('void.openAICompatible').get('endpoint'); this._webviewDeps.push('void.openAICompatible.endpoint'); if (openAICompatibleEndpoint) - allowed_urls.push(openAICompatibleEndpoint); + allowed_urls.push(openAICompatibleEndpoint+'/chat/completions'); const scriptUri = webview.asWebviewUri(vscode.Uri.joinPath(this._extensionUri, 'dist/sidebar/index.js')); const stylesUri = webview.asWebviewUri(vscode.Uri.joinPath(this._extensionUri, 'dist/sidebar/styles.css'));