fix: ssr open graph tags (#27639)

fix: SSR open graph tags
This commit is contained in:
Jason Rasmussen
2026-04-09 12:16:41 -04:00
committed by GitHub
parent b5bed02300
commit 7b269d1638
4 changed files with 38 additions and 50 deletions
+2 -2
View File
@@ -1,7 +1,7 @@
import { Injectable, NotAcceptableException } from '@nestjs/common';
import { NextFunction, Request, Response } from 'express';
import { escape } from 'lodash';
import { readFileSync } from 'node:fs';
import sanitizeHtml from 'sanitize-html';
import { ConfigRepository } from 'src/repositories/config.repository';
import { LoggingRepository } from 'src/repositories/logging.repository';
import { AuthService } from 'src/services/auth.service';
@@ -10,7 +10,7 @@ import { OpenGraphTags } from 'src/utils/misc';
export const render = (index: string, meta: OpenGraphTags) => {
const [title, description, imageUrl] = [meta.title, meta.description, meta.imageUrl].map((item) =>
item ? sanitizeHtml(item, { allowedTags: [] }) : '',
item ? escape(item) : '',
);
const tags = `