rack/rack — pull request #588 by statianzo (2013-07-18 23:41:45+00:00)
Title: Use equal? to compare form_input to rack.input

I was having issues with rack-contrib's [PostBodyContentTypeParser][1] when input was large enough to cause Puma and Thin to use Tempfiles as input. POST was not returning `env["rack.request_form_hash"]` as expected

I tracked the issue down to Rack::Request#POST's usage of `eql?`. It doesn't work for comparing tempfiles in 1.9 or 2.0. Changing it to `equal?` worked consistently on 1.8 and 1.9+ .

In 1.8, eql? compares Tempfiles correctly
In 1.9+, t.eql?(t) always returns false

In 1.8, == will change the position of the Tempfile.
In 1.9+, == compares Tempfiles correctly.

Using equal? provides consistent results of equality between 1.8, 1.9,
and 2.0 when comparing Tempfile objects.

[1]: https://github.com/rack/rack-contrib/blob/master/lib/rack/contrib/post_body_content_type_parser.rb