fix: prevent redirection of preview links

This commit is contained in:
DIYgod
2023-08-07 21:20:51 +01:00
parent 6d5b50ef14
commit 89ec224950
+1 -1
View File
@@ -98,7 +98,7 @@ export default async function SiteLayout({
let pathname = headers().get("x-xlog-pathname")
const onlyContent = isOnlyContent()
if (pathname?.startsWith("/site/")) {
if (pathname && /^(\/site(?!\/.*\/preview\/).*)/.test(pathname)) {
redirect(
`${getSiteLink({
subdomain: params.site,