1
0
mirror of synced 2025-12-19 18:10:59 -05:00

don't record temporary redirects (#25668)

This commit is contained in:
Peter Bengtsson
2022-02-25 13:45:31 -05:00
committed by GitHub
parent 3a3166a81c
commit 77bfe49215

View File

@@ -5,8 +5,8 @@ export default function recordRedirects(req, res, next) {
if (!req.hydro.maySend()) return next()
res.on('finish', async function recordRedirect() {
// We definitely don't want 304
if (![301, 302, 303, 307, 308].includes(res.statusCode)) return
// Basically only the "permanent" ones
if (![301, 308].includes(res.statusCode)) return
const schemaName = hydroNames.redirect
const redirectEvent = {
context: {