mirror of
https://github.com/openclaw/openclaw.git
synced 2026-07-17 00:51:39 +00:00
fix(voice-call): add timeout to guardedJsonApiRequest (#102884)
* fix(voice-call): add timeout to guardedJsonApiRequest * fix(voice-call): bound provider JSON requests --------- Co-authored-by: chengzhichao-xydt <chengzhichao-xydt@users.noreply.github.com> Co-authored-by: Peter Steinberger <steipete@gmail.com>
This commit is contained in:
committed by
GitHub
parent
54009c15bb
commit
5b916cb319
@@ -66,6 +66,7 @@ describe("guardedJsonApiRequest", () => {
|
||||
},
|
||||
policy: { allowedHostnames: ["api.example.com"] },
|
||||
auditContext: "voice-call:test",
|
||||
timeoutMs: 30_000,
|
||||
});
|
||||
expect(release).toHaveBeenCalledTimes(1);
|
||||
});
|
||||
|
||||
@@ -8,6 +8,8 @@ import {
|
||||
|
||||
// Shared guarded JSON API client for voice-call providers.
|
||||
|
||||
const VOICE_CALL_PROVIDER_API_TIMEOUT_MS = 30_000;
|
||||
|
||||
/** Parameters for an SSRF-guarded provider JSON request. */
|
||||
type GuardedJsonApiRequestParams = {
|
||||
url: string;
|
||||
@@ -33,6 +35,7 @@ export async function guardedJsonApiRequest<T = unknown>(
|
||||
},
|
||||
policy: { allowedHostnames: params.allowedHostnames },
|
||||
auditContext: params.auditContext,
|
||||
timeoutMs: VOICE_CALL_PROVIDER_API_TIMEOUT_MS,
|
||||
});
|
||||
|
||||
try {
|
||||
|
||||
Reference in New Issue
Block a user