Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

206
Visualizações
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 Respostas
Responde à pergunta

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 Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda