Skip to content

Instantly share code, notes, and snippets.

@tommylinks
Created June 10, 2020 07:21
Show Gist options
  • Save tommylinks/958d6ac3d03c9ba42876b887a0e5a5ca to your computer and use it in GitHub Desktop.
Save tommylinks/958d6ac3d03c9ba42876b887a0e5a5ca to your computer and use it in GitHub Desktop.
export default function ({ req, redirect }) {
console.log('starting')
if (req) {
if (req.headers['user-agent'].match(/Insights/gmi) || req.headers['user-agent'].match(/Lighthouse/gmi)) {
console.log('lighthouse detected')
redirect('/page.html')
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment