Revert "Parse body in multipart forms"

This reverts commit ca7c4dc0e8.
This commit is contained in:
Serdar Dogruyol 2017-11-20 15:01:16 +03:00
parent ca7c4dc0e8
commit a3a0f40468

View file

@ -43,8 +43,14 @@ module Kemal
private def parse_body private def parse_body
content_type = @request.content_type content_type = @request.content_type
return unless content_type return unless content_type
@body = parse_part(@request.body) if content_type.starts_with?(URL_ENCODED_FORM) if content_type.try(&.starts_with?(URL_ENCODED_FORM))
parse_file_upload if content_type.starts_with?(MULTIPART_FORM) @body = parse_part(@request.body)
return
end
if content_type.try(&.starts_with?(MULTIPART_FORM))
parse_file_upload
return
end
end end
private def parse_query private def parse_query
@ -69,7 +75,6 @@ module Kemal
@body[upload.name] = upload.body.gets_to_end @body[upload.name] = upload.body.gets_to_end
end end
end end
@body = parse_part(@request.body)
end end
# Parses JSON request body if Content-Type is `application/json`. # Parses JSON request body if Content-Type is `application/json`.