Reputation: 1344
I'm developing a web app using Angular5. I have a database that has some "posts" and each post contains an image URL that I take from 4chan API. The URL is legit (If I check it manually it works) but I get 403 forbidden in my console when I debug in the web browser. another weird thing, if I go to the URL manually and then refresh my app, the image is suddenly shown.
example URL : "http://i.4cdn.org/lgbt/1521711096067.jpg"
Upvotes: 3
Views: 4509
Reputation: 186
Looks like when the HTTP request header referrer is anything other than http://4chan.org, I get this issue. Ive simply added the below to the HTML page and its fixed the problem:
<meta name="referrer" content="no-referrer"/>
Once your Angular app is loaded, you can also use Firefox Developer Console (Network Tab) modify image request (ie 403) and remove referrer header to test.
Upvotes: 17