From db885e81b9dc918a75bd66b1631a13e10447d0ff Mon Sep 17 00:00:00 2001 From: Jeremy Kemper Date: Fri, 7 Dec 2007 04:20:20 +0000 Subject: Ignore illegal seeks on body rewind. Catches CGI errors depending on your httpd. Closes #10404 [Curtis Hawthorne] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8327 5ecf4fe2-1ee6-0310-87b1-e25e094e27de --- actionpack/lib/action_controller/request.rb | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'actionpack/lib/action_controller/request.rb') diff --git a/actionpack/lib/action_controller/request.rb b/actionpack/lib/action_controller/request.rb index a3eac357f7..785f6d424a 100755 --- a/actionpack/lib/action_controller/request.rb +++ b/actionpack/lib/action_controller/request.rb @@ -588,7 +588,13 @@ module ActionController end raise EOFError, "bad boundary end of body part" unless boundary_end=~/--/ - body.rewind if body.respond_to?(:rewind) + begin + body.rewind if body.respond_to?(:rewind) + rescue Errno::ESPIPE + # Handles exceptions raised by input streams that cannot be rewound + # such as when using plain CGI under Apache + end + params end end -- cgit v1.2.3