From 79a82e3a97e1ad9d057682ea3b4dc60fb714ec8a Mon Sep 17 00:00:00 2001 From: Jamis Buck Date: Sat, 18 Mar 2006 18:56:19 +0000 Subject: Make sure xml_simple requests don't blow up if an empty request body is recieved git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@3936 5ecf4fe2-1ee6-0310-87b1-e25e094e27de --- actionpack/lib/action_controller/cgi_ext/cgi_methods.rb | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'actionpack/lib/action_controller/cgi_ext') diff --git a/actionpack/lib/action_controller/cgi_ext/cgi_methods.rb b/actionpack/lib/action_controller/cgi_ext/cgi_methods.rb index f19e70839d..941646c530 100755 --- a/actionpack/lib/action_controller/cgi_ext/cgi_methods.rb +++ b/actionpack/lib/action_controller/cgi_ext/cgi_methods.rb @@ -63,11 +63,12 @@ class CGIMethods #:nodoc: when Proc strategy.call(raw_post_data) when :xml_simple - typecast_xml_value(XmlSimple.xml_in(raw_post_data, - 'forcearray' => false, - 'forcecontent' => true, - 'keeproot' => true, - 'contentkey' => '__content__')) + raw_post_data.blank? ? nil : + typecast_xml_value(XmlSimple.xml_in(raw_post_data, + 'forcearray' => false, + 'forcecontent' => true, + 'keeproot' => true, + 'contentkey' => '__content__')) when :yaml YAML.load(raw_post_data) when :xml_node -- cgit v1.2.3