@@ -304,7 +304,11 @@ func (c *controllerV1) handleGetWorkspaceSessions(w http.ResponseWriter, r *http
304 c.handleError(w, r, err)
304 c.handleError(w, r, err)
307+ result := make([]proto.Session, len(sessions))
308+ for i, s := range sessions {
309+ result[i] = sessionToProto(s)
307− jsonEncode(w, sessions)
311+ jsonEncode(w, result)
310// handlePostWorkspaceSessions creates a new session in a workspace.
314// handlePostWorkspaceSessions creates a new session in a workspace.
@@ -335,7 +339,7 @@ func (c *controllerV1) handlePostWorkspaceSessions(w http.ResponseWriter, r *htt
335 c.handleError(w, r, err)
339 c.handleError(w, r, err)
338− jsonEncode(w, sess)
342+ jsonEncode(w, sessionToProto(sess))
341// handleGetWorkspaceSession returns a single session.
345// handleGetWorkspaceSession returns a single session.
@@ -357,7 +361,7 @@ func (c *controllerV1) handleGetWorkspaceSession(w http.ResponseWriter, r *http.
357 c.handleError(w, r, err)
361 c.handleError(w, r, err)
360− jsonEncode(w, sess)
364+ jsonEncode(w, sessionToProto(sess))
363// handleGetWorkspaceSessionHistory returns the history for a session.
367// handleGetWorkspaceSessionHistory returns the history for a session.
@@ -433,7 +437,7 @@ func (c *controllerV1) handlePutWorkspaceSession(w http.ResponseWriter, r *http.
433 c.handleError(w, r, err)
437 c.handleError(w, r, err)
436− jsonEncode(w, saved)
440+ jsonEncode(w, sessionToProto(saved))
439// handleDeleteWorkspaceSession deletes a session.
443// handleDeleteWorkspaceSession deletes a session.