@@ -178,7 +178,7 @@ func verifyAuthWithOptions(options *common.VerifyOptions) func(ctx *context.Cont
178178 return
179179 }
180180
181- if ! options .SignOutRequired && ! options . DisableCrossOriginProtection {
181+ if ! options .SignOutRequired {
182182 if err := crossOrginProtection .Check (ctx .Req ); err != nil {
183183 http .Error (ctx .Resp , err .Error (), http .StatusForbidden )
184184 return
@@ -292,8 +292,6 @@ func Routes() *web.Router {
292292 return routes
293293}
294294
295- var optSignInAnyOrigin = verifyAuthWithOptions (& common.VerifyOptions {DisableCrossOriginProtection : true })
296-
297295// registerWebRoutes register routes
298296func registerWebRoutes (m * web.Router ) {
299297 // required to be signed in or signed out
@@ -489,7 +487,7 @@ func registerWebRoutes(m *web.Router) {
489487 m .Post ("/-/markup" , reqSignIn , web .Bind (structs.MarkupOption {}), misc .Markup )
490488
491489 m .Get ("/-/web-theme/list" , misc .WebThemeList )
492- m .Post ("/-/web-theme/apply" , optSignInAnyOrigin , misc .WebThemeApply )
490+ m .Post ("/-/web-theme/apply" , misc .WebThemeApply )
493491
494492 m .Group ("/explore" , func () {
495493 m .Get ("" , func (ctx * context.Context ) {
@@ -572,7 +570,7 @@ func registerWebRoutes(m *web.Router) {
572570 m .Methods ("POST, OPTIONS" , "/access_token" , web .Bind (forms.AccessTokenForm {}), auth .AccessTokenOAuth )
573571 m .Methods ("GET, OPTIONS" , "/keys" , auth .OIDCKeys )
574572 m .Methods ("POST, OPTIONS" , "/introspect" , web .Bind (forms.IntrospectTokenForm {}), auth .IntrospectOAuth )
575- }, optionsCorsHandler (), optSignInAnyOrigin )
573+ }, optionsCorsHandler ())
576574 }, oauth2Enabled )
577575
578576 m .Group ("/user/settings" , func () {
@@ -1655,7 +1653,7 @@ func registerWebRoutes(m *web.Router) {
16551653 m .Post ("/action/{action:accept_transfer|reject_transfer}" , reqSignIn , repo .ActionTransfer )
16561654 }, optSignIn , context .RepoAssignment )
16571655
1658- common .AddOwnerRepoGitLFSRoutes (m , optSignInAnyOrigin , lfsServerEnabled ) // "/{username}/{reponame}/{lfs-paths}": git-lfs support
1656+ common .AddOwnerRepoGitLFSRoutes (m , lfsServerEnabled ) // "/{username}/{reponame}/{lfs-paths}": git-lfs support
16591657
16601658 addOwnerRepoGitHTTPRouters (m ) // "/{username}/{reponame}/{git-paths}": git http support
16611659
0 commit comments