Skip to content

armgit / dub

Public Imported from GitHub
0

The modern link attribution platform. Loved by world-class engineering teams at Twilio, Zillow, Jobber, Vercel, Raycast, and more.

account for 403 forbidden

Steven Tey8a89ab148c76
diff --git a/lib/middleware/utils.ts b/lib/middleware/utils.ts
index e6c27f1302..08a433ca14 100644
--- a/lib/middleware/utils.ts
+++ b/lib/middleware/utils.ts
@@ -76,6 +76,11 @@ export const isIframeable = async ({
},
});
+ // if the request throws a status that's not 200, then it's not iframeable
+ if (!res.ok) {
+ return false;
+ }
+
const xFrameOptions = res.headers.get("X-Frame-Options"); // returns null if there is no `X-Frame-Options` header
if (xFrameOptions) {
return false;