Jump to content

Cross Origin Issue from Github


Recommended Posts

Hello !


I'm trying to load an image from a github repository into via Phaser.


I basically do something like this:

var path = "https://raw.githubusercontent.com/LadybugRiders/kimisrescue/dev/assets/images/blue_sky.jpg";loader.spritesheet( name, path, width, height);

Image that you can see here, just to show you it's accessible.


I've tried doing my own XMLHttpRequest, and display the image in a <img></img> and it was working quite well.


So, I looked in the forum and then set :

loader.crossOrigin = "anonymous"

That doesn't work either, as I still get the following error:

Image from origin 'https://raw.githubusercontent.com' has been blocked from loading by Cross-Origin Resource Sharing policy: The 'Access-Control-Allow-Origin' header has a value 'https://render.githubusercontent.com' that is not equal to the supplied origin. Origin 'http://localhost:5000' is therefore not allowed access.

I know about crossorigin policy but github shouldn't block me, if i believe the doc


Thanks for your help

Link to comment
Share on other sites


  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Create New...