Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

207
Vistas
Spoof client user agent in Next.js

I have a route that redirects iPhones, but no great way to test it:

export const getServerSideProps = async ({ req }) => {
  const isIphone = req.headers['user-agent'].match(/iPhone/i);

  if (isIphone) {
    return {
      redirect: {
        ...
      }
    }
  }

  return {
    props: {}
  };
}

Is there some way one can spoof the user agent head client side? It seems that changing the navigator.userAgent property does not suffice for whatever fetch function next.js is using under the hood.

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

  1. Is this a question about browser tasing? If So - Safari > Develop > Enter Responsive Design Mode > Dropdown
  2. Use an iPhone emulator.

Hopefully you are not accessing using any intermediaries who add headers.

about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda