Accept structured tunnel self-test timeouts

This commit is contained in:
Codex
2026-05-17 07:10:47 +00:00
parent c0a6f5cdbb
commit 6dfdfc3fb8
@@ -766,7 +766,8 @@ async function microserviceTunnelSelfTestResponse(service: MicroserviceConfig):
const bodyRecord = isPlainRecord(body) ? body : {};
const hasRequestId = typeof bodyRecord.requestId === "string" && bodyRecord.requestId.length > 0;
const hasStage = typeof bodyRecord.stage === "string" && bodyRecord.stage.length > 0;
const ok = response.status === 502 && hasRequestId && hasStage && headers.requestId === bodyRecord.requestId;
const expectedStatus = response.status === 502 || response.status === 504;
const ok = expectedStatus && hasRequestId && hasStage && headers.requestId === bodyRecord.requestId;
return jsonResponse({
ok,
serviceId: service.id,
@@ -775,7 +776,7 @@ async function microserviceTunnelSelfTestResponse(service: MicroserviceConfig):
expectedFailure: true,
status: response.status,
checks: {
expectedStatus: response.status === 502,
expectedStatus,
bodyHasRequestId: hasRequestId,
bodyHasStage: hasStage,
headerHasRequestId: typeof headers.requestId === "string" && headers.requestId.length > 0,