feat: add Makelore Robot hardware module
This commit is contained in:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user