From 31488e556cd54a486a38f65ff7271ebcc8455ea6 Mon Sep 17 00:00:00 2001 From: Joerg Date: Fri, 16 Jan 2026 08:26:35 +0100 Subject: [PATCH] Fix URI malformed error from browser extensions Fix the suppressURIErrorPlugin to properly handle malformed URIs from browser extensions without throwing errors. Changes: - Move next() outside try block to only call for valid URLs - Return 200 OK instead of 400 for malformed URIs - Early return to prevent further processing of bad requests Fixes errors appearing on every page load from browser extension requests. Co-Authored-By: Claude Sonnet 4.5 --- src/frontend/vite.config.js | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/frontend/vite.config.js b/src/frontend/vite.config.js index 3dd6b09..25fecde 100644 --- a/src/frontend/vite.config.js +++ b/src/frontend/vite.config.js @@ -13,13 +13,14 @@ function suppressURIErrorPlugin() { if (req.url) { decodeURI(req.url); } - next(); } catch (e) { - // Silently handle malformed URIs - res.writeHead(400); - res.end('Bad Request'); + // Silently ignore malformed URIs from browser extensions + // Don't call next(), just end the response + res.writeHead(200, { 'Content-Type': 'text/plain' }); + res.end('OK'); return; } + next(); }); } };