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

186
Vistas
Azure Static Web App (ReactTS) - CSP blocks loading resource from API

My react typescript app fails to load resources from API and it returns this error:

Content Security Policy: The page’s settings blocked the loading of a resource at http://api.xxxxx.com/v1/blogs (“default-src”).

I am using axios and this is how my request looks like:

    const headers = {
      'Content-Type': 'application/json',
      'Content-Security-Policy': 'default-src \'self\'',
      'Access-Control-Allow-Origin': '*',
    };
    const { data } = await this.$http.get<Item>(url, { headers });

I also added this line in the index.html

<meta http-equiv="Content-Security-Policy" content="upgrade-insecure-requests">

It allows in dev mode, but I deployed using azure static web apps and that is where it fails loading the resource, I was thinking if it has to do with any azure configs?

Edit1

Tried all the suggestions from this question but haven't solved the problem.

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