http:403 forbidden error when trying to load img src with google profile pic http:403 forbidden error when trying to load img src with google profile pic javascript javascript

http:403 forbidden error when trying to load img src with google profile pic


Using referrerpolicy="no-referrer" seems to help. While it didn't work in a localhost app (before I added this attribute), it worked consistently when loading the image in its own tab. One of the differences in the request headers was the absence of referer.


I was getting this error when accessing the localhost without any protocol mentioned. If your images aren't loading, try reopening the website giving http:// or https://That should solve the issue


Looks like google doesn't serve requests when the Referer header is set to localhost.I changed it in the inspecto to some other domain, resent it and it worked.I could even get the profile picture with curl and zero headers.