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