diff --git a/internal/manager/api_impl/jobs.go b/internal/manager/api_impl/jobs.go index fb6916e9..5005f21d 100644 --- a/internal/manager/api_impl/jobs.go +++ b/internal/manager/api_impl/jobs.go @@ -153,7 +153,7 @@ func (f *Flamenco) SetJobStatus(e echo.Context, jobID string) error { logger.Error().Err(err).Msg("error changing job status") return sendAPIError(e, http.StatusInternalServerError, "unexpected error changing job status") } - return e.String(http.StatusNoContent, "") + return e.NoContent(http.StatusNoContent) } func (f *Flamenco) TaskUpdate(e echo.Context, taskID string) error { @@ -199,7 +199,7 @@ func (f *Flamenco) TaskUpdate(e echo.Context, taskID string) error { return sendAPIError(e, http.StatusInternalServerError, "unable to handle status update: %v", err) } - return e.String(http.StatusNoContent, "") + return e.NoContent(http.StatusNoContent) } func (f *Flamenco) doTaskUpdate( diff --git a/internal/manager/api_impl/workers.go b/internal/manager/api_impl/workers.go index 64138ce9..79b8e18a 100644 --- a/internal/manager/api_impl/workers.go +++ b/internal/manager/api_impl/workers.go @@ -156,7 +156,7 @@ func (f *Flamenco) SignOff(e echo.Context) error { return sendAPIError(e, http.StatusInternalServerError, "error re-queueing your tasks") } - return e.String(http.StatusNoContent, "") + return e.NoContent(http.StatusNoContent) } // workerRequeueActiveTasks re-queues all active tasks (should be max one) of this worker. @@ -190,7 +190,7 @@ func (f *Flamenco) WorkerState(e echo.Context) error { worker := requestWorkerOrPanic(e) if worker.StatusRequested == "" { - return e.String(http.StatusNoContent, "") + return e.NoContent(http.StatusNoContent) } return e.JSON(http.StatusOK, api.WorkerStateChange{ @@ -236,7 +236,7 @@ func (f *Flamenco) WorkerStateChanged(e echo.Context) error { return sendAPIError(e, http.StatusInternalServerError, "error storing worker in database") } - return e.String(http.StatusNoContent, "") + return e.NoContent(http.StatusNoContent) } func (f *Flamenco) ScheduleTask(e echo.Context) error { @@ -275,7 +275,7 @@ func (f *Flamenco) ScheduleTask(e echo.Context) error { return sendAPIError(e, http.StatusInternalServerError, "internal error finding a task for you: %v", err) } if dbTask == nil { - return e.String(http.StatusNoContent, "") + return e.NoContent(http.StatusNoContent) } // Convert database objects to API objects: