| 818 | } |
| 819 | |
| 820 | static validateRouteAllowList(routeAllowList) { |
| 821 | if (routeAllowList === undefined || routeAllowList === null) { |
| 822 | return; |
| 823 | } |
| 824 | if (!Array.isArray(routeAllowList)) { |
| 825 | throw 'Parse Server option routeAllowList must be an array of strings.'; |
| 826 | } |
| 827 | for (const pattern of routeAllowList) { |
| 828 | if (typeof pattern !== 'string') { |
| 829 | throw `Parse Server option routeAllowList contains a non-string value.`; |
| 830 | } |
| 831 | try { |
| 832 | new RegExp('^' + pattern + '$'); |
| 833 | } catch { |
| 834 | throw `Parse Server option routeAllowList contains an invalid regex pattern: "${pattern}".`; |
| 835 | } |
| 836 | } |
| 837 | } |
| 838 | |
| 839 | static validateRateLimit(rateLimit) { |
| 840 | if (!rateLimit) { |