diff --git a/lib/thin/request.rb b/lib/thin/request.rb index aa8dcb23..eb49e306 100644 --- a/lib/thin/request.rb +++ b/lib/thin/request.rb @@ -13,7 +13,7 @@ class Request BODY_TMPFILE = 'thin-body'.freeze MAX_HEADER = 1024 * (80 + 32) - INITIAL_BODY = '' + INITIAL_BODY = String.new # Force external_encoding of request's body to ASCII_8BIT INITIAL_BODY.encode!(Encoding::ASCII_8BIT) if INITIAL_BODY.respond_to?(:encode!) && defined?(Encoding::ASCII_8BIT) @@ -52,7 +52,7 @@ class Request def initialize @parser = Thin::HttpParser.new - @data = '' + @data = String.new @nparsed = 0 @body = StringIO.new(INITIAL_BODY.dup) @env = {