Skip to content

Commit

Permalink
Return 404 instead of 403 if user can not access the repo (#23155) (#…
Browse files Browse the repository at this point in the history
…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>
  • Loading branch information
3 people committed Feb 26, 2023
1 parent 27879bc commit 1bc4ffc
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion routers/web/repo/http.go
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@ func httpBase(ctx *context.Context) (h *serviceHandler) {
}

if !p.CanAccess(accessMode, unitType) {
ctx.PlainText(http.StatusForbidden, "User permission denied")
ctx.PlainText(http.StatusNotFound, "Repository not found")
return
}
}
Expand Down

0 comments on commit 1bc4ffc

Please sign in to comment.