Search code examples
jsonpcorsgithub-pages

Is there a way to enable CORS on Github pages?


I'm hosting some JSON files on Github pages, but I am unable to use $.getJSON to retrieve them unless they come from the exact same domain.

Is there a way to enable CORS for Github pages?


Solution

  • Github Pages now has CORS enabled.

    The CORS header:

    Access-Control-Allow-Origin: *
    

    Is added by default on all responses from Github pages!