From: Eduardo San Martin Morote Date: Tue, 27 Dec 2022 13:07:05 +0000 (+0100) Subject: feat(warn): infinite redirection up to 30 X-Git-Tag: v4.2.0~67 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=376edd32c39af004ee3689f569f0da65418c9577;p=thirdparty%2Fvuejs%2Frouter.git feat(warn): infinite redirection up to 30 Close #1643 --- diff --git a/packages/router/src/router.ts b/packages/router/src/router.ts index f7edf8cb..e2d5bfab 100644 --- a/packages/router/src/router.ts +++ b/packages/router/src/router.ts @@ -716,10 +716,10 @@ export function createRouter(options: RouterOptions): Router { (redirectedFrom._count = redirectedFrom._count ? // @ts-expect-error redirectedFrom._count + 1 - : 1) > 10 + : 1) > 30 ) { warn( - `Detected an infinite redirection in a navigation guard when going from "${from.fullPath}" to "${toLocation.fullPath}". Aborting to avoid a Stack Overflow. This will break in production if not fixed.` + `Detected a possibly infinite redirection in a navigation guard when going from "${from.fullPath}" to "${toLocation.fullPath}". Aborting to avoid a Stack Overflow. This might break in production if not fixed.` ) return Promise.reject( new Error('Infinite redirect in navigation guard')