diff options
author | Hailey <me@haileyok.com> | 2025-03-20 15:08:54 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-03-20 15:08:54 -0700 |
commit | 52429b651f8e343112b3250df40c95d3e82eba5e (patch) | |
tree | b0772316f396b0d535e5f711ef62817137fe810f /bskylink/src | |
parent | 0e658dbdfdd4e6ece53ee04caf93d596034be587 (diff) | |
download | voidsky-52429b651f8e343112b3250df40c95d3e82eba5e.tar.zst |
blink: use meta for redirect (#8031)
* try using meta * color scheme * revert test change * escape
Diffstat (limited to 'bskylink/src')
-rw-r--r-- | bskylink/src/routes/redirect.ts | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/bskylink/src/routes/redirect.ts b/bskylink/src/routes/redirect.ts index 4e7052af7..519fe52a0 100644 --- a/bskylink/src/routes/redirect.ts +++ b/bskylink/src/routes/redirect.ts @@ -1,6 +1,7 @@ import assert from 'node:assert' import {DAY, SECOND} from '@atproto/common' +import escapeHTML from 'escape-html' import {Express} from 'express' import {AppContext} from '../context.js' @@ -40,8 +41,13 @@ export default function (ctx: AppContext, app: Express) { } res.setHeader('Cache-Control', `max-age=${(7 * DAY) / SECOND}`) - res.setHeader('Location', url.href) - return res.status(301).end() + res.type('html') + res.status(200) + + const escaped = escapeHTML(url.href) + return res.send( + `<html><head><meta http-equiv="refresh" content="0; URL='${escaped}'" /><style>:root { color-scheme: light dark; }</style></head></html>`, + ) }), ) } |