Permalink
Browse files

Fix rack.input for Rack::Lint on 1.9

  • Loading branch information...
1 parent ecc9002 commit 417fa930ab2413a9c3a37013340c85a2d519dccb @raggi committed Oct 25, 2009
Showing with 4 additions and 1 deletion.
  1. +4 −1 lib/thin/request.rb
View
@@ -49,7 +49,10 @@ def initialize
@parser = Thin::HttpParser.new
@data = ''
@nparsed = 0
- @body = StringIO.new
+ body = ''
+ # For Rack::Lint on 1.9, ensure that the encoding is always for spec
+ body.force_encoding('ASCII-8BIT') if body.respond_to?(:force_encoding)
+ @body = StringIO.new(body)
@env = {
SERVER_SOFTWARE => SERVER,
SERVER_NAME => LOCALHOST,

0 comments on commit 417fa93

Please sign in to comment.