1
1
mirror of https://github.com/go-gitea/gitea synced 2025-07-09 20:17:21 +00:00

Update HTTP status codes to modern codes (#18063)

* 2xx/3xx/4xx/5xx -> http.Status...
* http.StatusFound -> http.StatusTemporaryRedirect
* http.StatusMovedPermanently -> http.StatusPermanentRedirect
This commit is contained in:
KN4CK3R
2022-03-23 05:54:07 +01:00
committed by GitHub
parent 395117d301
commit 3f280f89e7
76 changed files with 211 additions and 212 deletions

View File

@ -151,7 +151,7 @@ func Dashboard(ctx *context.Context) {
func Milestones(ctx *context.Context) {
if unit.TypeIssues.UnitGlobalDisabled() && unit.TypePullRequests.UnitGlobalDisabled() {
log.Debug("Milestones overview page not available as both issues and pull requests are globally disabled")
ctx.Status(404)
ctx.Status(http.StatusNotFound)
return
}
@ -323,7 +323,7 @@ func Milestones(ctx *context.Context) {
func Pulls(ctx *context.Context) {
if unit.TypePullRequests.UnitGlobalDisabled() {
log.Debug("Pull request overview page not available as it is globally disabled.")
ctx.Status(404)
ctx.Status(http.StatusNotFound)
return
}
@ -336,7 +336,7 @@ func Pulls(ctx *context.Context) {
func Issues(ctx *context.Context) {
if unit.TypeIssues.UnitGlobalDisabled() {
log.Debug("Issues overview page not available as it is globally disabled.")
ctx.Status(404)
ctx.Status(http.StatusNotFound)
return
}