the-hideout / tarkov-dev

The official site for tarkov.dev - A web app to track item prices, view trader barters, quests, maps, and much more!
https://tarkov.dev
MIT License
130 stars 48 forks source link

[Issue] Discord Widget - CORS Errors #914

Closed DysektAI closed 2 months ago

DysektAI commented 2 months ago

Issue

When the discord iFrame is loaded into the page it throws multiple errors in the console: Access to image at 'https://cdn.discordapp.com/widget-avatars/' from origin 'https://discord.com' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource. I thought this was a bit odd so I checked what was causing it and realized for example this is one of the files being blocked:

Then I realized all of the errors include "default discord avatars" just different colors but any discord profile picture that is not set to a default avatar does not throw the error...

To test I then blocked the "discord iFrame" with ublock origin using cosmetic filters.. And no errors from discord anymore just the normal client blocked errors for trackers.

Expected Behavior

Discord Widget load without errors in the console

To Reproduce

Go to any page that has the footer and check console logs. Consistent across all browsers and platforms, it's an issue with the discord widget when fetching the default avatars they are missing a "Access-Control-Allow-Origin header" when its expected? Footer Github Link