Skip to content

Enable cors for file raw urls

Description

Enable cors for file raw urls

When you view a raw file uri in github such as https://raw.githubusercontent.com/<user>/<repo>/<branch>/<file>
it returns a response header
Access-Control-Allow-Origin *

This is useful for requesting protected files that require gitlab authentication within an application or from a static site.

Proposal

add header
Access-Control-Allow-Origin *
when making request to a raw file uri such as
https://gitlab.com/<user>/<repo>/raw/<branch>/<file>

Links / references

Edited by 🤖 GitLab Bot 🤖