Skip to content

Commit f37b324

Browse files
authored
Merge pull request #746 from Kilo-Org/chrarnoldus-patch-1
Fixes for OpenRouter base url
2 parents 136b371 + dfa49fb commit f37b324

File tree

4 files changed

+9
-4
lines changed

4 files changed

+9
-4
lines changed

.changeset/real-worms-win.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"kilo-code": patch
3+
---
4+
5+
Fix possible CSP error when loading OpenRouter endpoints from custom URL

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717

1818
### Patch Changes
1919

20-
- [#740](https://github.com/Kilo-Org/kilocode/pull/740) [`48af442`](https://github.com/Kilo-Org/kilocode/commit/48af4429e0815eb6366cfa3a37015eadbd1df126) Thanks [@chrarnoldus](https://github.com/chrarnoldus)! - The OpenRouter provider now uses the custom base URL when fetching the model list.
20+
- [#706](https://github.com/Kilo-Org/kilocode/pull/706) [`48af442`](https://github.com/Kilo-Org/kilocode/commit/48af4429e0815eb6366cfa3a37015eadbd1df126) Thanks [@cobra91](https://github.com/cobra91)! - The OpenRouter provider now uses the custom base URL when fetching the model list.
2121

2222
## [v4.37.0]
2323

src/core/webview/ClineProvider.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -739,8 +739,8 @@ export class ClineProvider extends EventEmitter<ClineProviderEvents> implements
739739
<meta charset="utf-8">
740740
<meta name="viewport" content="width=device-width,initial-scale=1,shrink-to-fit=no">
741741
<meta name="theme-color" content="#000000">
742-
<!-- kilocode_change: add https://*.googleusercontent.com https://*.googleapis.com to img-src -->
743-
<meta http-equiv="Content-Security-Policy" content="default-src 'none'; font-src ${webview.cspSource}; style-src ${webview.cspSource} 'unsafe-inline'; img-src ${webview.cspSource} https://*.googleusercontent.com https://storage.googleapis.com https://img.clerk.com data: https://*.googleapis.com; media-src ${webview.cspSource}; script-src ${webview.cspSource} 'wasm-unsafe-eval' 'nonce-${nonce}' https://us-assets.i.posthog.com 'strict-dynamic'; connect-src https://openrouter.ai https://api.requesty.ai https://us.i.posthog.com https://us-assets.i.posthog.com;">
742+
<!-- kilocode_change: add https://*.googleusercontent.com https://*.googleapis.com to img-src, https://* to connect-src -->
743+
<meta http-equiv="Content-Security-Policy" content="default-src 'none'; font-src ${webview.cspSource}; style-src ${webview.cspSource} 'unsafe-inline'; img-src ${webview.cspSource} https://*.googleusercontent.com https://storage.googleapis.com https://img.clerk.com data: https://*.googleapis.com; media-src ${webview.cspSource}; script-src ${webview.cspSource} 'wasm-unsafe-eval' 'nonce-${nonce}' https://us-assets.i.posthog.com 'strict-dynamic'; connect-src https://* https://openrouter.ai https://api.requesty.ai https://us.i.posthog.com https://us-assets.i.posthog.com;">
744744
<link rel="stylesheet" type="text/css" href="${stylesUri}">
745745
<link href="${codiconsUri}" rel="stylesheet" />
746746
<script nonce="${nonce}">

src/core/webview/__tests__/ClineProvider.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -374,7 +374,7 @@ describe("ClineProvider", () => {
374374

375375
// Verify Content Security Policy contains the necessary PostHog domains
376376
expect(mockWebviewView.webview.html).toContain(
377-
"connect-src https://openrouter.ai https://api.requesty.ai https://us.i.posthog.com https://us-assets.i.posthog.com",
377+
"connect-src https://* https://openrouter.ai https://api.requesty.ai https://us.i.posthog.com https://us-assets.i.posthog.com",
378378
)
379379

380380
// Extract the script-src directive section and verify required security elements

0 commit comments

Comments
 (0)