chore(backend): improve performance

This commit is contained in:
syuilo 2023-11-15 16:10:05 +09:00
parent 7d24b29eb8
commit be6778ac61

View File

@ -464,7 +464,7 @@ export class ApRendererService {
const attachment = profile.fields.map(field => ({ const attachment = profile.fields.map(field => ({
type: 'PropertyValue', type: 'PropertyValue',
name: field.name, name: field.name,
value: /^https?:/.test(field.value) value: (field.value.startsWith('http://') || field.value.startsWith('https://'))
? `<a href="${new URL(field.value).href}" rel="me nofollow noopener" target="_blank">${new URL(field.value).href}</a>` ? `<a href="${new URL(field.value).href}" rel="me nofollow noopener" target="_blank">${new URL(field.value).href}</a>`
: field.value, : field.value,
})); }));