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

185
Visualizações
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 à 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