fix: parse webhook URL pathname instead of raw string match

Fixes incorrect path matching that would reject valid webhooks with
querystrings and match unintended prefixes like /linq-webhookX.

Co-Authored-By: Claude Opus 4.6 <[email protected]>
This commit is contained in:
George McCain
2026-02-16 23:52:56 +01:00
committed by Peter Steinberger
co-authored by Claude Opus 4.6
parent d4a142fd8f
commit 60bd154e5a
+2 -1
View File
@@ -372,7 +372,8 @@ export async function monitorLinqProvider(opts: MonitorLinqOpts = {}): Promise<v
const port = linqCfg.webhookUrl ? new URL(linqCfg.webhookUrl).port || "0" : "0";
const server: Server = createServer(async (req: IncomingMessage, res: ServerResponse) => {
if (req.method !== "POST" || !req.url?.startsWith(webhookPath)) {
const url = new URL(req.url || "/", `http://${req.headers.host}`);
if (req.method !== "POST" || !url.pathname.startsWith(webhookPath)) {
res.writeHead(404);
res.end();
return;