Don't convert empty body on POST/PUT.#205
Conversation
When posting with content type 'application/json' and an empty body, multi_json crashes on the empty string.
|
This is great, thank you. Could you please update the CHANGELOG as part of the pull, I'll merge it. Also, I've always been confused whether we should be using def blank?
respond_to?(:empty?) ? empty? : !self
endAlthough we're splitting hair, I think |
|
I agree |
|
Merged, than you. |
|
With this commit I started getting "Fatal error: undefined method 'size' for #Rack::Lint::InputWrapper:0x86d92e8" under certain post circumstances while calling |
|
@adamgotterer => in theory this would work as well depending on how |
|
The current version would fail if it used the real #body_params method and not a mock. The failure case is when the body is plain text and not json. There is no #size method for a string. The change to #content_length wont break tests (I tried it earlier). But I'll spend a little time over the weekend trying to figure out a better way to test this. |
When posting with content type 'application/json' and an empty body, multi_json crashes on the empty string.