public
Description: A very fast & simple Ruby web server
Homepage: http://code.macournoyer.com/thin/
Clone URL: git://github.com/macournoyer/thin.git
Search Repo:
Fix "Connection: close" using a negated regexp
macournoyer (author)
Wed Jul 02 10:14:45 -0700 2008
commit  be8c627162a7d491d59e4390870c362845d23ed0
tree    f70c371ad8720609e6b6eab537c20e0c1553987e
parent  d6a6fc96165a6af2b38f738a6315c811b02a0dcf
...
23
24
25
26
 
27
28
29
...
110
111
112
113
 
114
115
116
...
23
24
25
 
26
27
28
29
...
110
111
112
 
113
114
115
116
0
@@ -23,7 +23,7 @@ module Thin
0
     CONTENT_LENGTH = 'CONTENT_LENGTH'.freeze
0
     CONNECTION = 'HTTP_CONNECTION'.freeze
0
     KEEP_ALIVE_REGEXP = /keep-alive/i
0
- NOT_CLOSE_REGEXP = /[^(close)]/i
0
+ CLOSE_REGEXP = /close/i
0
     
0
     # Freeze some Rack header names
0
     RACK_INPUT = 'rack.input'.freeze
0
@@ -110,7 +110,7 @@ module Thin
0
       # a Connection header including the connection-token "close" was sent
0
       # in the request
0
       else
0
- @env[CONNECTION].nil? || @env[CONNECTION] =~ NOT_CLOSE_REGEXP
0
+ @env[CONNECTION].nil? || @env[CONNECTION] !~ CLOSE_REGEXP
0
       end
0
     end
0
     

Comments

    No one has commented yet.