We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent b5ca929 commit fa3ee6cCopy full SHA for fa3ee6c
1 file changed
dashboard/electron/main/protocol.ts
@@ -28,12 +28,16 @@ const MIME_TYPES: Record<string, string> = {
28
'.webp': 'image/webp',
29
}
30
31
+function shouldProxyToBackend(pathname: string): boolean {
32
+ return pathname.startsWith('/api/') || pathname === '/maibot_statistics.html'
33
+}
34
+
35
export function registerAppProtocol(): void {
36
protocol.handle('app', async (request) => {
37
const url = new URL(request.url)
38
const pathname = url.pathname
39
- if (pathname.startsWith('/api/')) {
40
+ if (shouldProxyToBackend(pathname)) {
41
const backend = getActiveBackend()
42
const targetUrl = backend
43
? `${backend.url.replace(/\/$/, '')}${pathname}${url.search}`
0 commit comments