source for getorbyt.com getorbyt.com/
client bsky orbytapp app orbyt bluesky getorbyt orbytvideo atproto video
0
fork

Configure Feed

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

fix: update comment for clarity and correct context reference in middleware

+2 -2
+2 -2
src/middleware.ts
··· 54 54 * Non-English locales detected at the root path (`/`) are redirected to `/{locale}/`. 55 55 */ 56 56 export const onRequest = defineMiddleware(async (context, next) => { 57 - // Read Cloudflare geo-IP country — available via the cf object in Workers, 57 + // Read Cloudflare geo-IP country — available via context.request.cf in Astro v6, 58 58 // or the CF-IPCountry header when running behind Cloudflare. 59 - const cf = (context.locals as { runtime?: { cf?: { country?: string } } }).runtime?.cf 59 + const cf = (context.request as { cf?: { country?: string } }).cf 60 60 const rawCountry = cf?.country ?? context.request.headers.get('CF-IPCountry') ?? undefined 61 61 context.locals.countryCode = rawCountry?.toUpperCase() 62 62