diff --git a/server/build.go b/server/build.go index e3d50052e..91f7df8d1 100644 --- a/server/build.go +++ b/server/build.go @@ -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) } diff --git a/server/login.go b/server/login.go index a234d3849..af784222e 100644 --- a/server/login.go +++ b/server/login.go @@ -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(), })