Cross-Origin Resource Sharing on GitHub Pages

后端 未结 5 1821
栀梦
栀梦 2020-12-08 04:33

Is there a way to enable Cross-Origin Resource Sharing (CORS) for a static page hosted on GitHub Pages to allow cross-origin requests in Javascript?

For example, can

5条回答
  •  轻奢々
    轻奢々 (楼主)
    2020-12-08 05:25

    In my case, I was using a custom domain but I forgot to add the domain while deploying(ng deploy --base-href https://customdomain.com/). Check the network tab in dev-tools and observe the URL to check if it is generating the expected URL or not.

提交回复
热议问题