fix
This commit is contained in:
@@ -23,6 +23,7 @@ func Take(w http.ResponseWriter, r *http.Request) {
|
||||
w.WriteHeader(http.StatusInternalServerError)
|
||||
return
|
||||
}
|
||||
|
||||
var response TakeResponse
|
||||
if task == nil {
|
||||
response.Task = nil
|
||||
@@ -33,10 +34,12 @@ func Take(w http.ResponseWriter, r *http.Request) {
|
||||
Payload: task.Payload,
|
||||
}
|
||||
}
|
||||
|
||||
data, err := json.Marshal(response)
|
||||
if err != nil {
|
||||
w.WriteHeader(http.StatusInternalServerError)
|
||||
return
|
||||
}
|
||||
|
||||
w.Write(data)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user