This commit is contained in:
Linus Flood
2024-10-14 10:39:53 +02:00
parent a8f7c62f59
commit 10aa735a2e
2 changed files with 2 additions and 2 deletions

View File

@@ -46,7 +46,7 @@ const entryResponseCache: Map<
> = new Map()
let size: number = 0
export const fetchAndCacheEntry = async (path: string, lang?: Lang) => {
export const fetchAndCacheEntry = async (path: string, lang: Lang) => {
const cacheKey = `${path + lang}`
const cachedResponse = entryResponseCache.get(cacheKey)

View File

@@ -19,7 +19,7 @@ import type { MiddlewareMatcher } from "@/types/middleware"
export const middleware: NextMiddleware = async (request) => {
const { nextUrl } = request
const lang = findLang(nextUrl.pathname)
const lang = findLang(nextUrl.pathname)!
const loginTypeHeader = request.headers.get("loginType")
const loginTypeSearchParam = nextUrl.searchParams.get("loginType")