add title to hostname

This commit is contained in:
Samuel Newman
2025-04-25 15:17:03 +02:00
parent 1470223480
commit b692b57f67
+4 -3
View File
@@ -2,9 +2,9 @@ import assert from 'node:assert'
import {DAY, SECOND} from '@atproto/common'
import escapeHTML from 'escape-html'
import {Express} from 'express'
import {type Express} from 'express'
import {AppContext} from '../context.js'
import {type AppContext} from '../context.js'
import {handler} from './util.js'
const INTERNAL_IP_REGEX = new RegExp(
@@ -44,8 +44,9 @@ export default function (ctx: AppContext, app: Express) {
res.status(200)
const escaped = escapeHTML(url.href)
const escapedTitle = escapeHTML(url.hostname)
return res.send(
`<html><head><meta http-equiv="refresh" content="0; URL='${escaped}'" /><style>:root { color-scheme: light dark; }</style></head></html>`,
`<html><head><title>${escapedTitle}</title><meta http-equiv="refresh" content="0; URL='${escaped}'" /><style>:root { color-scheme: light dark; }</style></head></html>`,
)
}),
)