ZitHub

CORS Proxy for ZIP files on GitHub

ZIP files on GitHub cannot be fetched directly from the browser. This is because CORS headers are not set, so browsers refuse to fetch them.

ZitHub fixes this by serving as a server-side proxy.

Some limitation applyOnly the following URL patterns are supported:

  • From the API: https://api.github.com/repos/${owner}/${repo}/zipball/${ref}
  • From API download:
    • https://codeload.github.com/${owner}/${repo}/legacy.zip/refs/(heads|tags)/${ref}
    • https://codeload.github.com/${owner}/${repo}/zip/refs/(heads|tags)/${ref}
  • From a repository release or "Download ZIP" button: https://github.com/${owner}/${repo}/archive/refs/(heads|tags)/${ref}.zip
  • From a "Raw" link: https://raw.githubusercontent.com/${owner}/${repo}/refs/(heads|tags)/${ref}/${path}/${file}.zip

Usage

Call this with a URL appended to receive the ZIP file at that URL with Access-Control-Allow-Origin: * headers.


<script>
<script>
  fetch('https://zithub.pother.ca/https://github.com/owner/repo/archive/refs/heads/main/some.zip')
</script>