Use body.gets_to_end for parse_json. Fixes #260
This commit is contained in:
parent
cc44710654
commit
1826789e84
1 changed files with 1 additions and 1 deletions
|
@ -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|
|
||||
|
|
Loading…
Reference in a new issue