From 398f898217270318b8275a1aa2d80d5d24756a00 Mon Sep 17 00:00:00 2001 From: Andrew Jiang Date: Fri, 11 Oct 2024 20:47:38 -0400 Subject: [PATCH] update withSkewProtection --- packages/ui/app/src/util/withSkewProtection.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/packages/ui/app/src/util/withSkewProtection.ts b/packages/ui/app/src/util/withSkewProtection.ts index 1f0f93d00d..e861b3b261 100644 --- a/packages/ui/app/src/util/withSkewProtection.ts +++ b/packages/ui/app/src/util/withSkewProtection.ts @@ -1,9 +1,10 @@ +const deploymentId = process.env.NEXT_DEPLOYMENT_ID; export function withSkewProtection(headers?: HeadersInit): HeadersInit | undefined { - if (process.env.NEXT_DEPLOYMENT_ID == null) { + if (!deploymentId) { return headers; } const h = new Headers(headers); - h.set("x-deployment-id", process.env.NEXT_DEPLOYMENT_ID); + h.set("x-deployment-id", deploymentId); return h; }