about summary refs log tree commit homepage
path: root/lib/mongrel
diff options
context:
space:
mode:
authorzedshaw <zedshaw@19e92222-5c0b-0410-8929-a290d50e31e9>2006-08-03 20:49:11 +0000
committerzedshaw <zedshaw@19e92222-5c0b-0410-8929-a290d50e31e9>2006-08-03 20:49:11 +0000
commitf6b9b509b26f00ff12f59ef8d186e14e2947abd3 (patch)
tree2df631b0e50fb8cd90d5cd4fc3c4f16d3d5b7f5a /lib/mongrel
parent975a7aae803f4abf6fc1819b734bd504ca885255 (diff)
downloadunicorn-f6b9b509b26f00ff12f59ef8d186e14e2947abd3.tar.gz
git-svn-id: svn+ssh://rubyforge.org/var/svn/mongrel/trunk@299 19e92222-5c0b-0410-8929-a290d50e31e9
Diffstat (limited to 'lib/mongrel')
-rw-r--r--lib/mongrel/handlers.rb14
-rw-r--r--lib/mongrel/rails.rb2
2 files changed, 8 insertions, 8 deletions
diff --git a/lib/mongrel/handlers.rb b/lib/mongrel/handlers.rb
index fede2db..dc18ba9 100644
--- a/lib/mongrel/handlers.rb
+++ b/lib/mongrel/handlers.rb
@@ -203,18 +203,18 @@ module Mongrel
       # Calculated the same as apache, not sure how well the works on win32
       etag = Const::ETAG_FORMAT % [mtime.to_i, stat.size, stat.ino]
 
-      unmodified_since = request.params[Const::HTTP_IF_UNMODIFIED_SINCE]
+      modified_since = request.params[Const::HTTP_IF_MODIFIED_SINCE]
       none_match = request.params[Const::HTTP_IF_NONE_MATCH]
 
       # test to see if this is a conditional request, and test if
       # the response would be identical to the last response
       same_response = case
-                      when unmodified_since && !last_response_time = Time.httpdate(unmodified_since) rescue nil : false
-                      when unmodified_since && last_response_time > Time.now                                    : false
-                      when unmodified_since && mtime > last_response_time                                       : false
-                      when none_match       && none_match == '*'                                                : false
-                      when none_match       && !none_match.strip.split(/\s*,\s*/).include?(etag)                : false
-                      else unmodified_since || none_match  # validation successful if we get this far and at least one of the header exists
+                      when modified_since && !last_response_time = Time.httpdate(modified_since) rescue nil : false
+                      when modified_since && last_response_time > Time.now                                  : false
+                      when modified_since && mtime > last_response_time                                     : false
+                      when none_match     && none_match == '*'                                              : false
+                      when none_match     && !none_match.strip.split(/\s*,\s*/).include?(etag)              : false
+                      else modified_since || none_match  # validation successful if we get this far and at least one of the header exists
                       end
 
       header = response.header
diff --git a/lib/mongrel/rails.rb b/lib/mongrel/rails.rb
index 1e4cb42..6b4c7c1 100644
--- a/lib/mongrel/rails.rb
+++ b/lib/mongrel/rails.rb
@@ -77,7 +77,7 @@ module Mongrel
           rescue Errno::EPIPE
             # ignored
           rescue Object => rails_error
-            STDERR.puts "#{Tim.now}: Error calling Dispatcher.dispatch #{rails_error.inspect}"
+            STDERR.puts "#{Time.now}: Error calling Dispatcher.dispatch #{rails_error.inspect}"
             STDERR.puts rails_error.backtrace.join("\n")
           ensure
             @guard.unlock unless ActionController::Base.allow_concurrency