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
Why is CORS reporting my HTTP status is not ok?

I'm using https://add0n.com/access-control.html in order to bypass the CORS policy for an extension I'm making, however, I'm receiving this error:

Access to XMLHttpRequest at 'https://myexampleapi.com/' from origin 'https://www.somedomain.com' has been blocked by CORS policy: Response to preflight request doesn't pass access control check: It does not have HTTP ok status.

This is the code I'm using to access the API is:

var xmlHttp = new XMLHttpRequest();
xmlHttp.open("GET", 'https://api.example.com/test/getstats?userId=76561399568194663', true);
xmlHttp.setRequestHeader("ApiKey", "13cf02fb-fake-442f-f7cc-9ee44g48748b");
xmlHttp.onreadystatechange = function() {
    if (xmlHttp.readyState === 4) {
        console.log(xmlHttp.responseText)
    }
}
xmlHttp.send(null);

This error is ONLY occurring in Chrome and Firefox has no problems. I've been looking for 8 hours now and am getting desperate. Any advise on solving this?

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

0

So I found a solution. I ended up setting up a proxy server using PHP that uses CURL to call the API for me. This way, I would need to pass a custom header that was preventing me from bypassing CORS on Chrome. It works like a charm, but I was really hoping not to have to do this, so if anyone has any better ideas, let me know.

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