From 1826789e844af65b3cdee63cb97722c8def6144a Mon Sep 17 00:00:00 2001 From: sdogruyol Date: Fri, 25 Nov 2016 10:45:25 +0300 Subject: [PATCH] Use body.gets_to_end for parse_json. Fixes #260 --- src/kemal/param_parser.cr | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/kemal/param_parser.cr b/src/kemal/param_parser.cr index 4a46eb9..5e28fed 100644 --- a/src/kemal/param_parser.cr +++ b/src/kemal/param_parser.cr @@ -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|