another step
This commit is contained in:
@@ -9,6 +9,7 @@ import { headers } from 'next/headers';
|
||||
|
||||
import { API_URL } from '@/config';
|
||||
import { COOKIE_NAMES } from '@/lib/cookies';
|
||||
import { HEADER_NAMES } from '@/constants';
|
||||
import { getServerCookie } from '@/lib/cookies/server';
|
||||
import { ApiError } from './errors';
|
||||
|
||||
@@ -26,7 +27,7 @@ export async function serverFetch<T>(path: string, options?: RequestInit): Promi
|
||||
let locale = 'fa';
|
||||
try {
|
||||
const reqHeaders = await headers();
|
||||
locale = reqHeaders.get('x-next-intl-locale') ?? 'fa';
|
||||
locale = reqHeaders.get(HEADER_NAMES.LOCALE) ?? 'fa';
|
||||
} catch {
|
||||
// Outside request context (build-time prerendering) — use default locale
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user