File tree Expand file tree Collapse file tree 1 file changed +11
-0
lines changed Expand file tree Collapse file tree 1 file changed +11
-0
lines changed Original file line number Diff line number Diff line change @@ -29,6 +29,7 @@ import (
29
29
"code.gitea.io/gitea/modules/log"
30
30
"code.gitea.io/gitea/modules/process"
31
31
"code.gitea.io/gitea/modules/setting"
32
+ "code.gitea.io/gitea/modules/structs"
32
33
"code.gitea.io/gitea/modules/timeutil"
33
34
repo_service "code.gitea.io/gitea/services/repository"
34
35
)
@@ -135,6 +136,16 @@ func HTTP(ctx *context.Context) {
135
136
environ []string
136
137
)
137
138
139
+ // don't allow anonymous pulls if organization is not public
140
+ if isPublicPull {
141
+ if err := repo .GetOwner (); err != nil {
142
+ ctx .ServerError ("GetOwner" , err )
143
+ return
144
+ }
145
+
146
+ askAuth = askAuth || (repo .Owner .Visibility != structs .VisibleTypePublic )
147
+ }
148
+
138
149
// check access
139
150
if askAuth {
140
151
authUsername = ctx .Req .Header .Get (setting .ReverseProxyAuthUser )
You can’t perform that action at this time.
0 commit comments