mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-13 23:16:37 +00:00
fix: replace stale plugin webhook routes on re-registration
This commit is contained in:
@@ -29,10 +29,11 @@ export function registerPluginHttpRoute(params: {
|
||||
return () => {};
|
||||
}
|
||||
|
||||
if (routes.some((entry) => entry.path === normalizedPath)) {
|
||||
const existingIndex = routes.findIndex((entry) => entry.path === normalizedPath);
|
||||
if (existingIndex >= 0) {
|
||||
const pluginHint = params.pluginId ? ` (${params.pluginId})` : "";
|
||||
params.log?.(`plugin: webhook path ${normalizedPath} already registered${suffix}${pluginHint}`);
|
||||
return () => {};
|
||||
params.log?.(`plugin: replacing stale webhook path ${normalizedPath}${suffix}${pluginHint}`);
|
||||
routes.splice(existingIndex, 1);
|
||||
}
|
||||
|
||||
const entry: PluginHttpRouteRegistration = {
|
||||
|
||||
Reference in New Issue
Block a user