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

148
Views
Why the crossorigin works in localhost but was not in other devices

In a request from Instagram, the URL refers to images or cover of a video post can be seen by adding crossorigin to img tag and it works fine in localhost requests.

<img src="<%= image.thumbnail %>" alt="<%= image.caption %>" title="<%= image.caption %>"
                             class="img-fluid" crossorigin>

But when the web app is called on other devices (even in the same network) gets following error:

enter image description here

these lines were also added to the code but are not working

app.use(function (req, res, next) {
    res.header("Access-Control-Allow-Origin", "https://*.cdninstagram.com/*"); // update to match the domain you will make the request from
    res.header("Access-Control-Allow-Headers", "Origin, X-Requested-With, Content-Type, Accept");
    next();
});
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Instagram has introduced a strict-origin-when-cross-origin policy and is only allowing the following cross origin sites:

https://www.instagram.com
https://*.fbcdn.net
https://*.instagram.com
https://*.cdninstagram.com
https://*.facebook.com
https://*.fbsbx.com

This leads me to believe that they are restricting websites to display the API data. The data itself is still accessible, just not directly over a website. You would need to use a proxy or a server to resolve it

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