Skip to content

Commit 9f8d4a6

Browse files
committed
Declare JSON response type at router level
Signed-off-by: AndySung320 <andysung0320@gmail.com>
1 parent 7249ace commit 9f8d4a6

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

historyserver/pkg/historyserver/router.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,8 @@ func routerAPI(s *ServerHandler) {
134134
ws.Route(ws.GET("/v0/tasks/timeline").To(s.getTasksTimeline).Filter(s.CookieHandle).
135135
Doc("get tasks timeline").
136136
Param(ws.QueryParameter("job_id", "filter by job_id")).
137+
Param(ws.QueryParameter("download", "set to 1 to return response as attachment (timeline JSON file)")).
138+
Produces(restful.MIME_JSON).
137139
Writes("")) // Placeholder for specific return type
138140
}
139141

@@ -1001,7 +1003,6 @@ func (s *ServerHandler) getTasksTimeline(req *restful.Request, resp *restful.Res
10011003
return
10021004
}
10031005

1004-
resp.Header().Set("Content-Type", "application/json")
10051006
// Support download parameter
10061007
if download == "1" {
10071008
nowStr := time.Now().Format("2006-01-02_15-04-05")

0 commit comments

Comments
 (0)