mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-08 22:48:27 +00:00
Gateway: harden cron.runs jobId path handling (openclaw#24038) thanks @Takhoffman
Verified: - pnpm install --frozen-lockfile - pnpm build - pnpm check - pnpm test:macmini Co-authored-by: Takhoffman <781889+Takhoffman@users.noreply.github.com> Co-authored-by: Tak Hoffman <781889+Takhoffman@users.noreply.github.com>
This commit is contained in:
@@ -214,10 +214,20 @@ export const cronHandlers: GatewayRequestHandlers = {
|
||||
);
|
||||
return;
|
||||
}
|
||||
const logPath = resolveCronRunLogPath({
|
||||
storePath: context.cronStorePath,
|
||||
jobId,
|
||||
});
|
||||
let logPath: string;
|
||||
try {
|
||||
logPath = resolveCronRunLogPath({
|
||||
storePath: context.cronStorePath,
|
||||
jobId,
|
||||
});
|
||||
} catch {
|
||||
respond(
|
||||
false,
|
||||
undefined,
|
||||
errorShape(ErrorCodes.INVALID_REQUEST, "invalid cron.runs params: invalid id"),
|
||||
);
|
||||
return;
|
||||
}
|
||||
const entries = await readCronRunLogEntries(logPath, {
|
||||
limit: p.limit,
|
||||
jobId,
|
||||
|
||||
Reference in New Issue
Block a user