about summary refs log tree commit homepage
path: root/lib/yahns/http_response.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/yahns/http_response.rb')
-rw-r--r--lib/yahns/http_response.rb9
1 files changed, 4 insertions, 5 deletions
diff --git a/lib/yahns/http_response.rb b/lib/yahns/http_response.rb
index e48e57c..0b0296f 100644
--- a/lib/yahns/http_response.rb
+++ b/lib/yahns/http_response.rb
@@ -28,9 +28,6 @@ module Yahns::HttpResponse # :nodoc:
   Z = ""
   CCC_RESPONSE_START = [ 'HTTP', '/1.1 ' ]
   RESPONSE_START = CCC_RESPONSE_START.join
-  R100_RAW = "HTTP/1.1 100 Continue\r\n\r\n"
-  R100_CCC = "100 Continue\r\n\r\nHTTP/1.1 "
-  HTTP_EXPECT = "HTTP_EXPECT"
   REQUEST_METHOD = "REQUEST_METHOD"
   HEAD = "HEAD"
 
@@ -258,8 +255,10 @@ module Yahns::HttpResponse # :nodoc:
   # returns nil on success
   # returns :close, :wait_writable, or :wait_readable
   def http_100_response(env)
-    env.delete(HTTP_EXPECT) =~ /\A100-continue\z/i or return nil
-    buf = @response_start_sent ? R100_CCC : R100_RAW
+    env.delete("HTTP_EXPECT") =~ /\A100-continue\z/i or return
+    buf = @response_start_sent ? "100 Continue\r\n\r\nHTTP/1.1 ".freeze
+                               : "HTTP/1.1 100 Continue\r\n\r\n".freeze
+
     case rv = kgio_trywrite(buf)
     when String
       buf = rv