You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Access-Control-Allow-Origin mission on image requests #192
When an image is requested through an API call rather than through an image tag on the page the browser blocks the request due to missing Access-Control-Allow-Origin. I am using the API in a Unity game embedding the WebGL player in a website.
I would gladly contribute to the API but failed to find where the current header is set to move it to apply to images as well 😅
I had a similar problem with Access-Control-Allow-Origin. I solved it by adding the mode: "cors" and credentials: "omit" options to the request method. Can you try that please?
Activity
MattyDub commentedon Aug 30, 2022
I'm also seeing this issue. Was it ever addressed?
I'm trying to load an image like:
<img class="user-image" alt="User portrait" crossorigin="" src="https://randomuser.me/api/portraits/thumb/women/65.jpg" referrerpolicy="no-referrer">...and my browser dev tools return a "CORS missing allow origin" message.
Souvlaki42 commentedon Sep 8, 2022
I had a similar problem with Access-Control-Allow-Origin. I solved it by adding the mode: "cors" and credentials: "omit" options to the request method. Can you try that please?
MattyDub commentedon Sep 9, 2022
I was also able to get it to work. I was just using
elements, and the fix for me was to remove the cors-related attributes.