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

385
Vistas
Access to XMLHttpRequest at from origin has been blocked by CORS : The 'Access-Control-Allow-Origin' header contains multiple values '*, *', react

We have deployed our API's on amazon ec2 and we are using these API's on our frontend react.js. We already have set the headers 'Access-Control-Allow-Origin' to '*' in backend

// Preflight API
static setPreflight = async () => {

    const config = {
        headers: {
            'Authorization': `Bearer ${sessionStorage.getItem('authData')}`
        }
    }
    await axios.options(`http://-------/preflight`, config)
}

when we call this function only once to set headers for preflight but we got this error

Access to XMLHttpRequest at 'http://ec2-13-125-149-247--------/preflight' from origin 'http://localhost:3000' has been blocked by CORS policy: The 'Access-Control-Allow-Origin' header contains multiple values '*, *', but only one is allowed.

enter image description here

How to resolve this type of error on react.js?

about 4 years ago · Juan Pablo Isaza
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