diff --git a/src/kemal/param_parser.cr b/src/kemal/param_parser.cr index d1e5464..db54bad 100644 --- a/src/kemal/param_parser.cr +++ b/src/kemal/param_parser.cr @@ -55,7 +55,7 @@ module Kemal # If request body is a JSON Array it's added into `params` as `_json` and can be accessed # like params["_json"] def parse_json - return unless @request.body && @request.headers["Content-Type"]?.try(&.[APPLICATION_JSON]?) + return unless @request.body && @request.headers["Content-Type"]?.try(&.starts_with?(APPLICATION_JSON)) body = @request.body.as(String) case json = JSON.parse(body).raw