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:
Brad Rydzewski 2016-07-12 10:12:11 -07:00 committed by GitHub
commit 1dda838dee

View file

@ -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)
}
}