perf: improve matching paths in middleware (#19491)
* perf: exclude next native paths from going through middleware * fix build error * fix * fix
This commit is contained in:
1 parent
07a4aa6c7d
commit
5f5cfaf7c7
1 file changed
+1
-1
@@ -16,7 +16,7 @@ const safeGet = async <T = any>(key: string): Promise<T | undefined> => {
|
||||
}
|
||||
};
|
||||
|
||||
export const POST_METHODS_ALLOWED_API_ROUTES = ["/api"];
|
||||
export const POST_METHODS_ALLOWED_API_ROUTES = ["/api/"]; // trailing slash in "/api/" is actually important to block edge cases like `/api.php`
|
||||
// Some app routes are allowed because "revalidatePath()" is used to revalidate the cache for them
|
||||
export const POST_METHODS_ALLOWED_APP_ROUTES = ["/settings/my-account/general"];
|
||||
|
||||
|
||||
Reference in new issue
Block a user