feat: add Makelore Robot hardware module

This commit is contained in:
2026-08-13 23:17:22 +08:00
parent 22add3f01f
commit aba5cae286
25 changed files with 3169 additions and 72 deletions

View File

@@ -29,7 +29,15 @@ export function registerHostApiProxyHandlers(): void {
}
const method = (request.method || 'GET').toUpperCase();
const headers: Record<string, string> = { ...(request.headers || {}) };
const protectedHeaders = new Set([
'authorization',
RENDERER_CAPABILITY_HEADER.toLowerCase(),
]);
const headers = Object.fromEntries(
Object.entries(request.headers || {}).filter(
([name]) => !protectedHeaders.has(name.toLowerCase()),
),
);
// Inject the per-session auth token so the Host API server accepts this request.
headers['Authorization'] = `Bearer ${getHostApiToken()}`;
headers[RENDERER_CAPABILITY_HEADER] = getRendererCapability();