aboutsummaryrefslogblamecommitdiffstats
path: root/actionpack/lib/action_controller/rack_ext.rb
blob: 3d6f1f9256c8bf6cb1ced2d175ce2d1c03b64c19 (plain) (tree)
1
2
3
4
5
6
7
8
9
10







                                                      

                                             











                                                                               
module Rack
  module Utils
    module Multipart
      class << self
        def parse_multipart_with_rewind(env)
          result = parse_multipart_without_rewind(env)

          begin
            env['rack.input'].rewind
          rescue NoMethodError, Errno::ESPIPE
            # Handles exceptions raised by input streams that cannot be rewound
            # such as when using plain CGI under Apache
          end

          result
        end

        alias_method_chain :parse_multipart, :rewind
      end
    end
  end
end