diff options
author | William Hilton <wmhilton@gmail.com> | 2018-03-14 11:08:00 -0400 |
---|---|---|
committer | jc <u@gogs.io> | 2018-03-14 11:08:00 -0400 |
commit | 6a185e94b94d807ac0d0d008e991cac49b784e28 (patch) | |
tree | f1d27975d93ee82392835864391d186379f28304 /cmd | |
parent | ba0a78da2ac69315dd4c40dae5405194f1afae44 (diff) |
repo/http: add CORS headers to allow clone/push from browser agents (#4970)
Diffstat (limited to 'cmd')
-rw-r--r-- | cmd/web.go | 2 |
1 files changed, 2 insertions, 0 deletions
@@ -637,8 +637,10 @@ func runWeb(c *cli.Context) error { // e.g. with or without ".git" suffix. m.Group("/:reponame([\\d\\w-_\\.]+\\.git$)", func() { m.Get("", ignSignIn, context.RepoAssignment(), context.RepoRef(), repo.Home) + m.Options("/*", ignSignInAndCsrf, repo.HTTPContexter(), repo.HTTP) m.Route("/*", "GET,POST", ignSignInAndCsrf, repo.HTTPContexter(), repo.HTTP) }) + m.Options("/:reponame/*", ignSignInAndCsrf, repo.HTTPContexter(), repo.HTTP) m.Route("/:reponame/*", "GET,POST", ignSignInAndCsrf, repo.HTTPContexter(), repo.HTTP) }) // ***** END: Repository ***** |