Gitlab: can I configure a served javascript file to be served as the client can execute it?

Viewed 387

Version control repositories started to serve raw files as text/plain and to add the header content-type-options: nosniff so they can't be used as static hosting. I have an internal GitLab installation that I want to use to host some javascript (it would be used to access GitLab own API).

Is it possible to serve a raw file as Javascript? I'd like to turnoff the http header or change the mime-type of the serverd file.

1 Answers

No, it isn't possible to serve directly from the repository, since GitLab won't serve the correct mime type. If you want to do it, you probably need to use GitLab Pages.

Related