diff --git a/instrument.server.mjs b/instrument.server.mjs index 38f9a7e..486b0b6 100644 --- a/instrument.server.mjs +++ b/instrument.server.mjs @@ -12,12 +12,9 @@ Sentry.init({ /No route matches URL ".*\/(wp-admin|wp-login|phpmyadmin|xmlrpc)"/i, ], beforeSend(event) { - const url = event.request?.url ?? ""; const msg = event.exception?.values?.[0]?.value ?? ""; // Drop React Flight protocol probe errors (e.g. $1:aa:aa in multipart body) - if (msg.includes("$1:")) return null; - // Belt-and-suspenders: drop any remaining bot probe URL errors - if (/\.(php|env|htaccess|xml|aspx|bak|sql)$|wp-admin|phpmyadmin/i.test(url)) return null; + if (/\$\d+:[a-z]/.test(msg)) return null; return event; }, -}); \ No newline at end of file +}); diff --git a/server/app.ts b/server/app.ts index 379e435..2de2ca3 100644 --- a/server/app.ts +++ b/server/app.ts @@ -13,7 +13,7 @@ app.use((_, __, next) => DatabaseContext.run(db, next)); // Block common bot probe paths before React Router (and Sentry) see them const BOT_PROBE_RE = - /\.(php|env|git|htaccess|xml|aspx|asp|jsp|config|bak|sql|ini|log|swp|DS_Store)$|^\/(wp-admin|wp-login|phpmyadmin|xmlrpc|server-status|cgi-bin|shell|cmd|console|actuator)(\/|$)/i; + /\.(php|env|htaccess|aspx|asp|jsp|config|bak|sql|ini|swp|DS_Store)$|^\/(wp-admin|wp-login|phpmyadmin|xmlrpc|server-status|cgi-bin|shell|cmd|console|actuator)(\/|$)/i; app.use((req, res, next) => { if (BOT_PROBE_RE.test(req.path)) {