mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-08 16:28:26 +00:00
refactor: route browser control via gateway/node
This commit is contained in:
@@ -1,14 +1,13 @@
|
||||
import type express from "express";
|
||||
|
||||
import type { BrowserRouteContext, ProfileContext } from "../server-context.js";
|
||||
import { parseBooleanValue } from "../../utils/boolean.js";
|
||||
import type { BrowserRequest, BrowserResponse } from "./types.js";
|
||||
|
||||
/**
|
||||
* Extract profile name from query string or body and get profile context.
|
||||
* Query string takes precedence over body for consistency with GET routes.
|
||||
*/
|
||||
export function getProfileContext(
|
||||
req: express.Request,
|
||||
req: BrowserRequest,
|
||||
ctx: BrowserRouteContext,
|
||||
): ProfileContext | { error: string; status: number } {
|
||||
let profileName: string | undefined;
|
||||
@@ -33,7 +32,7 @@ export function getProfileContext(
|
||||
}
|
||||
}
|
||||
|
||||
export function jsonError(res: express.Response, status: number, message: string) {
|
||||
export function jsonError(res: BrowserResponse, status: number, message: string) {
|
||||
res.status(status).json({ error: message });
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user