Skip to content

Commit bd36677

Browse files
bearcherianmraerino
authored andcommitted
Updating response for /claims 204 response (#193)
When a 204 is sent, no content is allowed. But using `sendJSON` creates a response body with empty content and a "Content-Type" header. This sets the status as 204, but returns no content as the spec requires.
1 parent 1d34e0f commit bd36677

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

api/order.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,8 @@ func (a *API) ClaimOrders(w http.ResponseWriter, r *http.Request) error {
145145
}
146146

147147
log.Info("Finished updating")
148-
return sendJSON(w, http.StatusNoContent, "")
148+
w.WriteHeader(http.StatusNoContent)
149+
return nil
149150
}
150151

151152
// ReceiptView renders an HTML receipt for an order

0 commit comments

Comments
 (0)