mirror of
https://github.com/openclaw/openclaw.git
synced 2026-04-03 03:03:24 -04:00
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 <noreply@anthropic.com>
This commit is contained in:
committed by
Peter Steinberger
parent
d4a142fd8f
commit
60bd154e5a
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user