From 6a185e94b94d807ac0d0d008e991cac49b784e28 Mon Sep 17 00:00:00 2001 From: William Hilton Date: Wed, 14 Mar 2018 11:08:00 -0400 Subject: repo/http: add CORS headers to allow clone/push from browser agents (#4970) --- cmd/web.go | 2 ++ 1 file changed, 2 insertions(+) (limited to 'cmd') diff --git a/cmd/web.go b/cmd/web.go index bdbb9c6e..efaeb6c9 100644 --- a/cmd/web.go +++ b/cmd/web.go @@ -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 ***** -- cgit v1.2.3