add title to hostname
This commit is contained in:
@@ -2,9 +2,9 @@ import assert from 'node:assert'
|
|||||||
|
|
||||||
import {DAY, SECOND} from '@atproto/common'
|
import {DAY, SECOND} from '@atproto/common'
|
||||||
import escapeHTML from 'escape-html'
|
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'
|
import {handler} from './util.js'
|
||||||
|
|
||||||
const INTERNAL_IP_REGEX = new RegExp(
|
const INTERNAL_IP_REGEX = new RegExp(
|
||||||
@@ -44,8 +44,9 @@ export default function (ctx: AppContext, app: Express) {
|
|||||||
res.status(200)
|
res.status(200)
|
||||||
|
|
||||||
const escaped = escapeHTML(url.href)
|
const escaped = escapeHTML(url.href)
|
||||||
|
const escapedTitle = escapeHTML(url.hostname)
|
||||||
return res.send(
|
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>`,
|
||||||
)
|
)
|
||||||
}),
|
}),
|
||||||
)
|
)
|
||||||
|
|||||||
Reference in New Issue
Block a user