Cors options to get Gists

Viewed 485

I tried to embed my gist with github script. I have a NodeJS ExpressJS app, create a static page and paste script tag that was generated by github.gist. And now i got an error:

my-website:35 Cross-Origin Read Blocking (CORB) blocked cross-origin response https://gist.github.com/PinkyRabbit/7f2db625ae53d799b5ecc4b710c65644 with MIME type text/html. See https://www.chromestatus.com/feature/5629709824032768 for more details.

I tried to allow cors with the cors module, but even if I use default setting to open cors for all domains cors() - nothing changed, github.gists still blocked.

1 Answers

Gist appears to be supported with CORS on RawGit

curl -I https://raw.githack.com/gist/Rapptz/c4324f17a80c94776832430007ad40e6/raw/c92df8492be3679635dee0e80273b2ffb6a64cbf/dpy_development_plans.md
HTTP/1.1 200 OK
Date: Sun, 06 Mar 2022 06:56:13 GMT
Content-Type: text/markdown; charset=utf-8
...
Access-Control-Allow-Origin: *

There are a lot of catches though, so read carefully through the link.

Related