Accept structured tunnel self-test timeouts
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user