perf: fetch data server side for /settings/webhooks (#20583)

* update client components

* update server components

* update middleware

* fix

* fix

---------

Co-authored-by: Keith Williams <[email protected]>
This commit is contained in:
Benny JooandKeith Williams authored and GitHub committed 2025-04-07 18:21:13 +00:00
1 parent e9b5aa6f22
commit 134086f229
12 files changed
+144 -98

No files matched your search

+4 -1
View File
@@ -18,7 +18,10 @@ const safeGet = async <T = any>(key: string): Promise<T | undefined> => {
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"];
export const POST_METHODS_ALLOWED_APP_ROUTES = [
"/settings/my-account/general",
"/settings/developer/webhooks",
];
export function checkPostMethod(req: NextRequest) {
const pathname = req.nextUrl.pathname;