Automatically add trailing slash to webhook urls (#2076)

* Add trailing slash to webhook url if not present

Relates to community post https://community.n8n.io/t/problem-with-google-calendar-credentials/7232

We'll be adding a trailing slash as it's a requisite.

* Adding slash to all cases.
This commit is contained in:
Omar Ajoue 2021-08-12 11:22:44 +02:00 committed by GitHub
parent 92f98d4bcc
commit 63bc4097e0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -463,6 +463,9 @@ export function getWebhookBaseUrl() {
// @ts-ignore // @ts-ignore
urlBaseWebhook = process.env.WEBHOOK_TUNNEL_URL || process.env.WEBHOOK_URL; urlBaseWebhook = process.env.WEBHOOK_TUNNEL_URL || process.env.WEBHOOK_URL;
} }
if (!urlBaseWebhook.endsWith('/')) {
urlBaseWebhook += '/';
}
return urlBaseWebhook; return urlBaseWebhook;
} }