Use body.gets_to_end for parse_json. Fixes #260

This commit is contained in:
sdogruyol 2016-11-25 10:45:25 +03:00
parent cc44710654
commit 1826789e84

View file

@ -64,7 +64,7 @@ module Kemal
def parse_json
return unless @request.body && @request.headers["Content-Type"]?.try(&.starts_with?(APPLICATION_JSON))
body = @request.body.to_s
body = @request.body.not_nil!.gets_to_end
case json = JSON.parse(body).raw
when Hash
json.each do |key, value|