Closed pvmeerbe closed 9 years ago
Thanks for the patch! But Object#present?
is a Rails method, not pure Ruby. I'd also like a test case if this is to make it into master.
I reworked the .present? function & added related tests.
I also provided a fix specifically for Grape with status 405 response (see last commit)
Thanks for the patch! Merging. :+1:
According to HTTP spec,status code 204 should not have a body The current code checks for 'response.body' to achieve this.
However Rack sends empty string as body for a 204 status code which is considered a body when using the response.body check. As a result deserializing from Json fails. using .present? solves this issue
related rack information: