Skip to content

Commit

Permalink
update withSkewProtection
Browse files Browse the repository at this point in the history
  • Loading branch information
abvthecity committed Oct 12, 2024
1 parent 4ca4a78 commit 398f898
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions packages/ui/app/src/util/withSkewProtection.ts
Original file line number Diff line number Diff line change
@@ -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;
}

0 comments on commit 398f898

Please sign in to comment.