mirror of
https://github.com/n8n-io/n8n.git
synced 2024-12-24 04:04:06 -08:00
🔨 improve handling of leading /
This commit is contained in:
parent
b3bf6f04b8
commit
d8f175a010
|
@ -275,7 +275,7 @@ export class ActiveWorkflowRunner {
|
|||
webhook.webhookId = node.webhookId;
|
||||
}
|
||||
|
||||
if (webhook.webhookPath.charAt(0) === '/') {
|
||||
if (webhook.webhookPath.startsWith('/')) {
|
||||
webhook.webhookPath = webhook.webhookPath.slice(1);
|
||||
}
|
||||
|
||||
|
@ -302,7 +302,6 @@ export class ActiveWorkflowRunner {
|
|||
// TODO check if there is standard error code for duplicate key violation that works
|
||||
// with all databases
|
||||
if (error.name === 'MongoError' || error.name === 'QueryFailedError') {
|
||||
console.log(error);
|
||||
errorMessage = error.parameters.length === 5
|
||||
? `Node [${webhook.node}] can't be saved, please duplicate [${webhook.node}] and delete the currently existing one.`
|
||||
: `The webhook path [${webhook.webhookPath}] and method [${webhook.method}] already exist.`;
|
||||
|
|
|
@ -893,6 +893,9 @@ export function getNodeWebhookUrl(baseUrl: string, workflowId: string, node: INo
|
|||
// setting this to false to prefix the webhookId
|
||||
isFullPath = false;
|
||||
}
|
||||
if (path.startsWith('/')) {
|
||||
path = path.slice(1);
|
||||
}
|
||||
return `${baseUrl}/${getNodeWebhookPath(workflowId, node, path, isFullPath)}`;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue