1
0
mirror of https://github.com/woodpecker-ci/woodpecker.git synced 2024-12-24 10:07:21 +02:00

use correct content-type for logs

This commit is contained in:
Brad Rydzewski 2016-06-14 14:01:20 -07:00
parent 08a4bf06a5
commit 8de93539e3
2 changed files with 5 additions and 4 deletions

View File

@ -26,7 +26,7 @@ func GetBuilds(c *gin.Context) {
c.AbortWithStatus(http.StatusInternalServerError)
return
}
c.IndentedJSON(http.StatusOK, builds)
c.JSON(http.StatusOK, builds)
}
func GetBuild(c *gin.Context) {
@ -54,7 +54,7 @@ func GetBuild(c *gin.Context) {
Jobs []*model.Job `json:"jobs"`
}{build, jobs}
c.IndentedJSON(http.StatusOK, &out)
c.JSON(http.StatusOK, &out)
}
func GetBuildLast(c *gin.Context) {
@ -73,7 +73,7 @@ func GetBuildLast(c *gin.Context) {
Jobs []*model.Job `json:"jobs"`
}{build, jobs}
c.IndentedJSON(http.StatusOK, &out)
c.JSON(http.StatusOK, &out)
}
func GetBuildLogs(c *gin.Context) {
@ -111,6 +111,7 @@ func GetBuildLogs(c *gin.Context) {
// TODO implement limited streaming to avoid crashing the browser
}
c.Header("Content-Type", "application/json")
stream.Copy(c.Writer, r)
}

View File

@ -152,7 +152,7 @@ func GetLoginToken(c *gin.Context) {
return
}
c.IndentedJSON(http.StatusOK, &tokenPayload{
c.JSON(http.StatusOK, &tokenPayload{
Access: tokenstr,
Expires: exp - time.Now().Unix(),
})