@@ -174,14 +174,15 @@ func Routes(ctx gocontext.Context) *web.Route {
174
174
return routes
175
175
}
176
176
177
+ var ignSignInAndCsrf = auth_service .VerifyAuthWithOptions (& auth_service.VerifyOptions {DisableCSRF : true })
178
+
177
179
// registerRoutes register routes
178
180
func registerRoutes (m * web.Route ) {
179
181
reqSignIn := auth_service .VerifyAuthWithOptions (& auth_service.VerifyOptions {SignInRequired : true })
180
182
reqSignOut := auth_service .VerifyAuthWithOptions (& auth_service.VerifyOptions {SignOutRequired : true })
181
183
// TODO: rename them to "optSignIn", which means that the "sign-in" could be optional, depends on the VerifyOptions (RequireSignInView)
182
184
ignSignIn := auth_service .VerifyAuthWithOptions (& auth_service.VerifyOptions {SignInRequired : setting .Service .RequireSignInView })
183
185
ignExploreSignIn := auth_service .VerifyAuthWithOptions (& auth_service.VerifyOptions {SignInRequired : setting .Service .RequireSignInView || setting .Service .Explore .RequireSigninView })
184
- ignSignInAndCsrf := auth_service .VerifyAuthWithOptions (& auth_service.VerifyOptions {DisableCSRF : true })
185
186
validation .AddBindingRules ()
186
187
187
188
linkAccountEnabled := func (ctx * context.Context ) {
@@ -1377,19 +1378,7 @@ func registerRoutes(m *web.Route) {
1377
1378
})
1378
1379
}, ignSignInAndCsrf , lfsServerEnabled )
1379
1380
1380
- m .Group ("" , func () {
1381
- m .PostOptions ("/git-upload-pack" , repo .ServiceUploadPack )
1382
- m .PostOptions ("/git-receive-pack" , repo .ServiceReceivePack )
1383
- m .GetOptions ("/info/refs" , repo .GetInfoRefs )
1384
- m .GetOptions ("/HEAD" , repo .GetTextFile ("HEAD" ))
1385
- m .GetOptions ("/objects/info/alternates" , repo .GetTextFile ("objects/info/alternates" ))
1386
- m .GetOptions ("/objects/info/http-alternates" , repo .GetTextFile ("objects/info/http-alternates" ))
1387
- m .GetOptions ("/objects/info/packs" , repo .GetInfoPacks )
1388
- m .GetOptions ("/objects/info/{file:[^/]*}" , repo .GetTextFile ("" ))
1389
- m .GetOptions ("/objects/{head:[0-9a-f]{2}}/{hash:[0-9a-f]{38}}" , repo .GetLooseObject )
1390
- m .GetOptions ("/objects/pack/pack-{file:[0-9a-f]{40}}.pack" , repo .GetPackFile )
1391
- m .GetOptions ("/objects/pack/pack-{file:[0-9a-f]{40}}.idx" , repo .GetIdxFile )
1392
- }, ignSignInAndCsrf , repo .HTTPGitEnabledHandler , repo .CorsHandler (), context_service .UserAssignmentWeb ())
1381
+ gitHTTPRouters (m )
1393
1382
})
1394
1383
})
1395
1384
// ***** END: Repository *****
0 commit comments