diff options
author | Madeline <46743919+MaddyUnderStars@users.noreply.github.com> | 2022-09-22 01:54:56 +1000 |
---|---|---|
committer | Madeline <46743919+MaddyUnderStars@users.noreply.github.com> | 2022-09-22 02:31:56 +1000 |
commit | b9a93f16723714751d03fe8d05607e366634b1b1 (patch) | |
tree | 0f2f55c6adb04746fbf522005c6c6ade5aa56e18 | |
parent | fix my shit (diff) | |
download | server-b9a93f16723714751d03fe8d05607e366634b1b1.tar.xz |
Fixed? sentry stuff
-rw-r--r-- | bundle/src/Server.ts | 33 |
1 files changed, 25 insertions, 8 deletions
diff --git a/bundle/src/Server.ts b/bundle/src/Server.ts index d6200f83..db417f11 100644 --- a/bundle/src/Server.ts +++ b/bundle/src/Server.ts @@ -76,16 +76,33 @@ async function main() { ], tracesSampleRate: Config.get().sentry.traceSampleRate, environment: Config.get().sentry.environment, - beforeSend: (event, hint) => { - const url = event.request?.url; - if (url && url.includes("/assets/")) return null; + }); + + Sentry.addGlobalEventProcessor((event, hint) => { + if (event.transaction) { + event.transaction = event.transaction.split("/").map(x => !parseInt(x) ? x : ":id").join("/"); + } + + delete event.request?.cookies; + if (event.request?.headers) { + delete event.request.headers["X-Real-Ip"]; + delete event.request.headers["X-Forwarded-For"]; + delete event.request.headers["X-Forwarded-Host"]; + delete event.request.headers["X-Super-Properties"]; + } + + if (event.breadcrumbs) { + event.breadcrumbs = event.breadcrumbs.filter(x => { + if (x.message?.includes("identified as")) return false; + if (x.message?.includes("[WebSocket] closed 4009 ")) return false; + if (x.message?.includes("Got Resume -> cancel not implemented")) return false; + if (x.message?.includes("[Gateway] New connection from")) return false; - if (event.request?.url) { - event.request.url = event.request.url.split("/").map(x => !parseInt(x) ? x : ":id").join("/"); - } + return true; + }) + } - return event; - }, + return event; }); app.use(Sentry.Handlers.requestHandler()); |