Skip to content

Commit 10ceb85

Browse files
authored
fix: cloudfront timeouts not being caught (#1162)
1 parent c405ae7 commit 10ceb85

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

apps/webapp/app/models/endpoint.server.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ export function detectResponseIsTimeout(rawBody: string, response?: Response) {
2727

2828
return (
2929
isResponseVercelTimeout(response) ||
30+
isResponseCloudfrontTimeout(response) ||
3031
isResponseDenoDeployTimeout(rawBody, response) ||
3132
isResponseCloudflareTimeout(rawBody, response)
3233
);
@@ -50,3 +51,7 @@ function isResponseVercelTimeout(response: Response) {
5051
function isResponseDenoDeployTimeout(rawBody: string, response: Response) {
5152
return response.status === 502 && rawBody.includes("TIME_LIMIT");
5253
}
54+
55+
function isResponseCloudfrontTimeout(response: Response) {
56+
return response.status === 504 && typeof response.headers.get("x-amz-cf-id") === "string";
57+
}

0 commit comments

Comments
 (0)