Permalink
Browse files

Enforce binary encoding in RewindableInput; fixes Ruby 1.9 issues.

Signed-off-by: Joshua Peek <josh@joshpeek.com>
  • Loading branch information...
1 parent 07c1814 commit 6df2248be0b323124cb491fa2f89b6b82f539f32 @FooBarWidget FooBarWidget committed with josh Jun 17, 2009
Showing with 2 additions and 0 deletions.
  1. +2 −0 lib/rack/rewindable_input.rb
View
2 lib/rack/rewindable_input.rb
@@ -72,6 +72,8 @@ def make_rewindable
# access it because we have the file handle open.
@rewindable_io = Tempfile.new('RackRewindableInput')
@rewindable_io.chmod(0000)
+ @rewindable_io.set_encoding(Encoding::BINARY) if @rewindable_io.respond_to?(:set_encoding)
+ @rewindable_io.binmode
if filesystem_has_posix_semantics?
@rewindable_io.unlink
@unlinked = true

0 comments on commit 6df2248

Please sign in to comment.