fix(cli): include "auth-excluded" endpoints on the history middleware as well (#4028)

right now endpoints defined in `N8N_AUTH_EXCLUDE_ENDPOINTS` are skipping the JWT auth, and the history middleware is returning 404 on these urls. This change ensures that these endpoints skip all auth-related middlewares.
This commit is contained in:
कारतोफ्फेलस्क्रिप्ट™ 2022-09-05 20:39:48 +02:00 committed by GitHub
parent 287533e6c8
commit d554128457
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -665,8 +665,16 @@ class App {
rewrites: [
{
from: new RegExp(
// eslint-disable-next-line no-useless-escape
`^\/(${this.restEndpoint}|healthz|metrics|css|js|${this.endpointWebhook}|${this.endpointWebhookTest})\/?.*$`,
`^/(${[
'healthz',
'metrics',
'css',
'js',
this.restEndpoint,
this.endpointWebhook,
this.endpointWebhookTest,
...excludeEndpoints.split(':'),
].join('|')})/?.*$`,
),
to: (context) => {
return context.parsedUrl.pathname!.toString();