fix(SW-2754): Fixed issue where server rendered html included faulty links

Approved-by: Matilda Landström
This commit is contained in:
Erik Tiekstra
2025-05-16 06:21:09 +00:00
parent 4f8483305d
commit 2401615caa
12 changed files with 67 additions and 78 deletions
@@ -0,0 +1,14 @@
import { headers } from "next/headers"
import { getLang } from "@/i18n/serverContext"
export function appendSlugToPathname(slug?: string) {
const pathname = headers().get("x-pathname")
const lang = getLang()
if (!pathname || !slug) {
return null
}
return `/${lang}${pathname}/${slug}`
}