mirror of
https://github.com/woodpecker-ci/woodpecker.git
synced 2024-11-27 04:11:03 +00:00
Merge pull request #1710 from strk/badgeNone-200
Make badgeNone usable in HTML img tag (returning 200 instead of 404)
This commit is contained in:
commit
1dda838dee
1 changed files with 4 additions and 2 deletions
|
@ -3,6 +3,7 @@ package server
|
|||
import (
|
||||
"fmt"
|
||||
|
||||
log "github.com/Sirupsen/logrus"
|
||||
"github.com/gin-gonic/gin"
|
||||
|
||||
"github.com/drone/drone/model"
|
||||
|
@ -42,7 +43,8 @@ func GetBadge(c *gin.Context) {
|
|||
|
||||
build, err := store.GetBuildLast(c, repo, branch)
|
||||
if err != nil {
|
||||
c.String(404, badgeNone)
|
||||
log.Warning(err)
|
||||
c.String(200, badgeNone)
|
||||
return
|
||||
}
|
||||
|
||||
|
@ -56,7 +58,7 @@ func GetBadge(c *gin.Context) {
|
|||
case model.StatusPending, model.StatusRunning:
|
||||
c.String(200, badgeStarted)
|
||||
default:
|
||||
c.String(404, badgeNone)
|
||||
c.String(200, badgeNone)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue