From b008dffe70149888164213fc70cc1099d4e14ee6 Mon Sep 17 00:00:00 2001 From: chlins Date: Mon, 3 Aug 2020 09:45:18 +0800 Subject: [PATCH] fix(preheat): fix preheat task log display Signed-off-by: chlins --- api/v2.0/swagger.yaml | 5 +++++ src/server/v2.0/handler/preheat.go | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/api/v2.0/swagger.yaml b/api/v2.0/swagger.yaml index 339b2e7e6..12d10c36d 100644 --- a/api/v2.0/swagger.yaml +++ b/api/v2.0/swagger.yaml @@ -10,6 +10,7 @@ schemes: basePath: /api/v2.0 produces: - application/json + - text/plain consumes: - application/json securityDefinitions: @@ -1145,6 +1146,10 @@ paths: responses: '200': description: Get log success + headers: + Content-Type: + description: Content type of response + type: string schema: type: string '400': diff --git a/src/server/v2.0/handler/preheat.go b/src/server/v2.0/handler/preheat.go index cc56d772b..21b5010f5 100644 --- a/src/server/v2.0/handler/preheat.go +++ b/src/server/v2.0/handler/preheat.go @@ -679,7 +679,7 @@ func (api *preheatAPI) GetLog(ctx context.Context, params operation.GetLogParams return api.SendError(ctx, err) } - return operation.NewGetLogOK().WithPayload(string(l)) + return operation.NewGetLogOK().WithPayload(string(l)).WithContentType("text/plain") } // ListProvidersUnderProject is Get all providers at project level