mirror of
https://github.com/woodpecker-ci/woodpecker.git
synced 2024-11-27 04:11:03 +00:00
badge content-type was in wrong function
This commit is contained in:
parent
ecdd001811
commit
598c553c3f
1 changed files with 4 additions and 2 deletions
|
@ -36,6 +36,10 @@ func GetBadge(c web.C, w http.ResponseWriter, r *http.Request) {
|
||||||
branch = c.URLParams["branch"]
|
branch = c.URLParams["branch"]
|
||||||
)
|
)
|
||||||
|
|
||||||
|
// an SVG response is always served, even when error, so
|
||||||
|
// we can go ahead and set the content type appropriately.
|
||||||
|
w.Header().Set("Content-Type", "image/svg+xml")
|
||||||
|
|
||||||
repo, err := datastore.GetRepoName(ctx, host, owner, name)
|
repo, err := datastore.GetRepoName(ctx, host, owner, name)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
w.Write(badgeNone)
|
w.Write(badgeNone)
|
||||||
|
@ -82,8 +86,6 @@ func GetCC(c web.C, w http.ResponseWriter, r *http.Request) {
|
||||||
name = c.URLParams["name"]
|
name = c.URLParams["name"]
|
||||||
)
|
)
|
||||||
|
|
||||||
w.Header().Set("Content-Type", "image/svg+xml")
|
|
||||||
|
|
||||||
repo, err := datastore.GetRepoName(ctx, host, owner, name)
|
repo, err := datastore.GetRepoName(ctx, host, owner, name)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
w.Write(badgeNone)
|
w.Write(badgeNone)
|
||||||
|
|
Loading…
Reference in a new issue