You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The current implementation of EncodeJSONResponse always writes an HTTP response body.
When the status should be http.StatusNoContent, there shouldn't be any response body.
In my own code I've done a check like this:
if e, ok := response.(statusCoder); ok {
w.WriteHeader(e.status())
if e.status() == http.StatusNoContent {
return nil
}
}
Should the EncodeJSONResponse have a check for 204 responses? I can send a PR but wanted to make sure it's wanted first.
The text was updated successfully, but these errors were encountered:
The current implementation of
EncodeJSONResponse
always writes an HTTP response body.When the status should be
http.StatusNoContent
, there shouldn't be any response body.In my own code I've done a check like this:
Should the EncodeJSONResponse have a check for 204 responses? I can send a PR but wanted to make sure it's wanted first.
The text was updated successfully, but these errors were encountered: