a tool for shared writing and social publishing
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

rewrite route as prefix to allow for subroutes

This fixes icons and url previews

+7 -3
+7 -3
middleware.ts
··· 29 29 .eq("domain", hostname) 30 30 .single(); 31 31 if (routes) { 32 - let route = routes.custom_domain_routes.find( 33 - (r) => r.route === req.nextUrl.pathname, 32 + let route = routes.custom_domain_routes.find((r) => 33 + req.nextUrl.pathname.startsWith(r.route), 34 34 ); 35 35 if (route) 36 36 return NextResponse.rewrite( 37 - new URL(`/${route.view_permission_token}`, req.url), 37 + new URL( 38 + `/${route.view_permission_token}` + 39 + req.nextUrl.pathname.slice(route.route.length), 40 + req.url, 41 + ), 38 42 ); 39 43 else { 40 44 return NextResponse.redirect(new URL("/not-found", req.url));