@@ -275,14 +275,16 @@ func Routes() *web.Route {
275
275
return routes
276
276
}
277
277
278
+ var ignSignInAndCsrf = verifyAuthWithOptions (& common.VerifyOptions {DisableCSRF : true })
279
+
278
280
// registerRoutes register routes
279
281
func registerRoutes (m * web.Route ) {
280
282
reqSignIn := verifyAuthWithOptions (& common.VerifyOptions {SignInRequired : true })
281
283
reqSignOut := verifyAuthWithOptions (& common.VerifyOptions {SignOutRequired : true })
282
284
// TODO: rename them to "optSignIn", which means that the "sign-in" could be optional, depends on the VerifyOptions (RequireSignInView)
283
285
ignSignIn := verifyAuthWithOptions (& common.VerifyOptions {SignInRequired : setting .Service .RequireSignInView })
284
286
ignExploreSignIn := verifyAuthWithOptions (& common.VerifyOptions {SignInRequired : setting .Service .RequireSignInView || setting .Service .Explore .RequireSigninView })
285
- ignSignInAndCsrf := verifyAuthWithOptions ( & common. VerifyOptions { DisableCSRF : true })
287
+
286
288
validation .AddBindingRules ()
287
289
288
290
linkAccountEnabled := func (ctx * context.Context ) {
@@ -1511,19 +1513,7 @@ func registerRoutes(m *web.Route) {
1511
1513
})
1512
1514
}, ignSignInAndCsrf , lfsServerEnabled )
1513
1515
1514
- m .Group ("" , func () {
1515
- m .PostOptions ("/git-upload-pack" , repo .ServiceUploadPack )
1516
- m .PostOptions ("/git-receive-pack" , repo .ServiceReceivePack )
1517
- m .GetOptions ("/info/refs" , repo .GetInfoRefs )
1518
- m .GetOptions ("/HEAD" , repo .GetTextFile ("HEAD" ))
1519
- m .GetOptions ("/objects/info/alternates" , repo .GetTextFile ("objects/info/alternates" ))
1520
- m .GetOptions ("/objects/info/http-alternates" , repo .GetTextFile ("objects/info/http-alternates" ))
1521
- m .GetOptions ("/objects/info/packs" , repo .GetInfoPacks )
1522
- m .GetOptions ("/objects/info/{file:[^/]*}" , repo .GetTextFile ("" ))
1523
- m .GetOptions ("/objects/{head:[0-9a-f]{2}}/{hash:[0-9a-f]{38}}" , repo .GetLooseObject )
1524
- m .GetOptions ("/objects/pack/pack-{file:[0-9a-f]{40}}.pack" , repo .GetPackFile )
1525
- m .GetOptions ("/objects/pack/pack-{file:[0-9a-f]{40}}.idx" , repo .GetIdxFile )
1526
- }, ignSignInAndCsrf , repo .HTTPGitEnabledHandler , repo .CorsHandler (), context_service .UserAssignmentWeb ())
1516
+ gitHTTPRouters (m )
1527
1517
})
1528
1518
})
1529
1519
// ***** END: Repository *****
0 commit comments