Compare commits
1
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
36ee91498d |
@@ -18,7 +18,9 @@ export default async function DomainMiddleware(req: NextRequest) {
|
||||
// Subdomain available, rewriting
|
||||
// >>> Rewriting: ${path} to /view/domains/${host}${path}`
|
||||
url.pathname = `/view/domains/${host}${path}`;
|
||||
return NextResponse.rewrite(url, PAPERMARK_HEADERS);
|
||||
const response = NextResponse.rewrite(url, PAPERMARK_HEADERS);
|
||||
response.headers.set("Cache-Control", "public, max-age=0, must-revalidate");
|
||||
return response;
|
||||
} else {
|
||||
// redirect plain custom domain to papermark.io, eventually to it's own landing page
|
||||
return NextResponse.redirect(new URL("https://www.papermark.io", req.url));
|
||||
|
||||
@@ -230,7 +230,8 @@ export default async function handle(
|
||||
...linkData,
|
||||
};
|
||||
|
||||
res.status(200).json({ linkType, link: returnLink, brand });
|
||||
res.setHeader("Cache-Control", "public, max-age=0, must-revalidate");
|
||||
return res.status(200).json({ linkType, link: returnLink, brand });
|
||||
} catch (error) {
|
||||
log({
|
||||
message: `Cannot get link for custom domain _${domainSlug}_ \n\n${error}`,
|
||||
|
||||
Reference in New Issue
Block a user