From 6e6b1c2ab36b1da998efd82791d25c5d4c948836 Mon Sep 17 00:00:00 2001 From: Jeremy Evans Date: Fri, 8 Jan 2016 14:43:27 -0800 Subject: [PATCH] Work with ruby 2.3's --enable-frozen-string-literal These changes are the minimal ones necessary to allow Roda's specs to pass. There may well be other changes that are required. --- lib/thin/request.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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 = {