Add requesty to connect-src (#2155)

This commit is contained in:
Matt Rubens 2025-03-31 13:51:21 -04:00 committed by GitHub
parent a6ed5ce0ea
commit 136cf99885
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 7 additions and 2 deletions

View file

@ -0,0 +1,5 @@
---
"roo-cline": patch
---
Fix bug in loading Requesty key balance

View file

@ -705,7 +705,7 @@ export class ClineProvider extends EventEmitter<ClineProviderEvents> implements
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,initial-scale=1,shrink-to-fit=no">
<meta name="theme-color" content="#000000">
<meta http-equiv="Content-Security-Policy" content="default-src 'none'; font-src ${webview.cspSource}; style-src ${webview.cspSource} 'unsafe-inline'; img-src ${webview.cspSource} data:; script-src 'nonce-${nonce}' https://us-assets.i.posthog.com; connect-src https://openrouter.ai https://us.i.posthog.com https://us-assets.i.posthog.com;">
<meta http-equiv="Content-Security-Policy" content="default-src 'none'; font-src ${webview.cspSource}; style-src ${webview.cspSource} 'unsafe-inline'; img-src ${webview.cspSource} data:; script-src 'nonce-${nonce}' https://us-assets.i.posthog.com; connect-src https://openrouter.ai https://api.requesty.ai https://us.i.posthog.com https://us-assets.i.posthog.com;">
<link rel="stylesheet" type="text/css" href="${stylesUri}">
<link href="${codiconsUri}" rel="stylesheet" />
<script nonce="${nonce}">

View file

@ -378,7 +378,7 @@ describe("ClineProvider", () => {
// Verify Content Security Policy contains the necessary PostHog domains
expect(mockWebviewView.webview.html).toContain(
"connect-src https://openrouter.ai https://us.i.posthog.com https://us-assets.i.posthog.com;",
"connect-src https://openrouter.ai https://api.requesty.ai https://us.i.posthog.com https://us-assets.i.posthog.com;",
)
expect(mockWebviewView.webview.html).toContain("script-src 'nonce-")
})