Skip to content

Commit

Permalink
Merge pull request #11618 from github/repo-sync
Browse files Browse the repository at this point in the history
repo sync
  • Loading branch information
Octomerger authored Nov 2, 2021
2 parents 9dda5df + 07887d4 commit d6bb1af
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion middleware/record-redirect.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
import { v4 as uuidv4 } from 'uuid'
import { hydroNames } from '../lib/schema-event.js'

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
const schemaName = req.hydro.schemas.redirect
const schemaName = hydroNames.redirect
const redirectEvent = {
context: {
user: req.cookies['_docs-events'] || uuidv4(),
Expand Down

0 comments on commit d6bb1af

Please sign in to comment.