fix(SW-3075): Fixed issue where URLs rendered differently in source HTML in compared to client
Approved-by: Matilda Landström
This commit is contained in:
@@ -0,0 +1,11 @@
|
||||
import { headers } from "next/headers"
|
||||
|
||||
import { getLang } from "@/i18n/serverContext"
|
||||
|
||||
export async function getPathname() {
|
||||
const headersList = await headers()
|
||||
const lang = await getLang()
|
||||
const pathname = headersList.get("x-pathname") || ""
|
||||
|
||||
return `/${lang}${pathname}`
|
||||
}
|
||||
Reference in New Issue
Block a user