Enable CORS on Gogs


#1

I am trying to enable CORS on my gogs server.

After searching the git repo I found https://github.com/gogits/gogs/commit/b9bb4a62d60c0e8b863f160e5f35e67b94c18e6c

This commit seems to indicate that there is an option in setting.HTTP.AccessControlAllowOrigin … which is great, and I am assuming that “settings” is a reference to “app.ini”

In the app.ini I added the following:

[http]
ACCESS_CONTROL_ALLOW_ORIGIN = true

and restarted my gogs server … but it did not seem to have any effect.

Thoughts?


#2

Never mind … re-read the code in the commit … setting should be:

[http]
ACCESS_CONTROL_ALLOW_ORIGIN = *