You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add limits to the number of router rule registration (#1752)
Limitations are set to the following values:
* max conditions: 1024
* max depth: 10
(Please see the PR description to understand how they are counted)
TypeError on exceeding the limits.
---------
Co-authored-by: Yoshisato Yanagisawa <[email protected]>
Co-authored-by: Domenic Denicola <[email protected]>
Note: Router conditions can be complex and nested using {{RouterCondition/_or}} and {{RouterCondition/not}}. To prevent excessive processing, this algorithm introduces two limits. First, the total number of conditions, counting all nested conditions, cannot exceed 1024. Second, the nesting depth is limited to 10 levels to avoid exponential computation.
3490
+
3491
+
1. Let |result| be a [=count router condition result=].
3492
+
1. Set |result|'s [=count router condition result/condition count=] to 1024.
3493
+
1. Set |result|'s [=count router condition result/quota exceeded=] to false.
3494
+
1. [=list/For each=] |rule| of |routerRules|:
3495
+
1. Set |result| to be the result of running [=Count Router Inner Conditions=] with |rule|["{{RouterRule/condition}}"], |result|, and 10.
3496
+
1. If |result|'s [=count router condition result/quota exceeded=] is true, return false.
0 commit comments