summary refs log tree commit homepage
diff options
context:
space:
mode:
authorEric Wong <normalperson@yhbt.net>2009-07-16 01:26:58 -0700
committerEric Wong <normalperson@yhbt.net>2009-07-16 01:26:58 -0700
commit7db0e317dee3514fd80cc0a97a9b78a7a893ec22 (patch)
tree9da8ea9f45a4485d8bb7be6e03eee722f21e7431
parent72764ceeaf537cce45d900187bf8643663fc530d (diff)
Regexps can be run against nil just fine
-rw-r--r--lib/unicorn/http_request.rb8
1 files changed, 3 insertions, 5 deletions
diff --git a/lib/unicorn/http_request.rb b/lib/unicorn/http_request.rb
index a9e9d23..ec215ae 100644
--- a/lib/unicorn/http_request.rb
+++ b/lib/unicorn/http_request.rb
@@ -81,11 +81,9 @@ module Unicorn
       PARAMS[Const::RACK_INPUT] = if (body = PARAMS.delete(:http_body))
         length = PARAMS[Const::CONTENT_LENGTH].to_i
 
-        if te = PARAMS[Const::HTTP_TRANSFER_ENCODING]
-          if /\Achunked\z/i =~ te
-            socket = ChunkedReader.new(PARAMS, socket, body)
-            length = body = nil
-          end
+        if /\Achunked\z/i =~ PARAMS[Const::HTTP_TRANSFER_ENCODING]
+          socket = ChunkedReader.new(PARAMS, socket, body)
+          length = body = nil
         end
 
         TeeInput.new(socket, length, body)