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

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Recently Browsing   0 members

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