From 0fbd7dffdbf8169f3cb17b78b556e1acd47a0be4 Mon Sep 17 00:00:00 2001 From: dangered wolf Date: Tue, 22 Aug 2023 01:53:46 -0400 Subject: [PATCH] Show js exception error in embeds now by returning 200 --- src/experiments.ts | 2 +- src/server.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/experiments.ts b/src/experiments.ts index d6aea2c..c93d5b7 100644 --- a/src/experiments.ts +++ b/src/experiments.ts @@ -19,7 +19,7 @@ const Experiments: { [key in Experiment]: ExperimentConfig } = { export const experimentCheck = (experiment: Experiment, condition = true) => { console.log(`Checking experiment ${experiment}`); const experimentEnabled = - Experiments[experiment].percentage > Math.random() && condition; + (Experiments[experiment].percentage > Math.random()) && condition; console.log(`Experiment ${experiment} enabled: ${experimentEnabled}`); return experimentEnabled; }; diff --git a/src/server.ts b/src/server.ts index bf70d00..51bbdd7 100644 --- a/src/server.ts +++ b/src/server.ts @@ -520,7 +520,7 @@ const sentryWrapper = async (event: FetchEvent, test = false): Promise => 'content-type': 'text/html', 'cache-control': 'max-age=1' }, - status: 500 + status: 200 }); } })()