Skip to content

Commit 1bc4ffc

Browse files
yardenshohamyp05327lunny
authored
Return 404 instead of 403 if user can not access the repo (#23155) (#23158)
Backport #23155 Fixes #23150 Before: ![image](https://user-images.githubusercontent.com/18380374/221390802-2317c6bc-d163-4def-b68b-6bb297143fe2.png) After: ![image](https://user-images.githubusercontent.com/18380374/221390823-87490351-39c3-4a40-b1d2-11fc5b85fa24.png) Co-authored-by: yp05327 <576951401@qq.com> Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
1 parent 27879bc commit 1bc4ffc

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

routers/web/repo/http.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,7 @@ func httpBase(ctx *context.Context) (h *serviceHandler) {
228228
}
229229

230230
if !p.CanAccess(accessMode, unitType) {
231-
ctx.PlainText(http.StatusForbidden, "User permission denied")
231+
ctx.PlainText(http.StatusNotFound, "Repository not found")
232232
return
233233
}
234234
}

0 commit comments

Comments
 (0)