mirror of
https://gitea.invidious.io/iv-org/shard-kemal.git
synced 2024-08-15 00:53:36 +00:00
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
|
def parse_json
|
||||||
return unless @request.body && @request.headers["Content-Type"]?.try(&.starts_with?(APPLICATION_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
|
case json = JSON.parse(body).raw
|
||||||
when Hash
|
when Hash
|
||||||
json.each do |key, value|
|
json.each do |key, value|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue