From 8de93539e3ba06d034f23798fd23d3cbf7eb9482 Mon Sep 17 00:00:00 2001 From: Brad Rydzewski Date: Tue, 14 Jun 2016 14:01:20 -0700 Subject: [PATCH] use correct content-type for logs --- server/build.go | 7 ++++--- server/login.go | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/server/build.go b/server/build.go index e3d50052..91f7df8d 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 a234d384..af784222 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(), })