Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

187
Views
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
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!