From b0e316e37c1637c4a407f768bfb0220d20a11414 Mon Sep 17 00:00:00 2001 From: Jacques Distler Date: Mon, 1 Oct 2007 22:09:51 -0500 Subject: [PATCH] Minor Fixes Get rid of Redefined CONSTANT warning. Make WEBrick respond to TERM signal. (Launchd, in particular, requires this.) Rollback superfluous change to rails/actionpack/lib/action_controller/base.rb. Handled by the action_cache plugin. --- app/controllers/application.rb | 2 +- vendor/rails/actionpack/lib/action_controller/base.rb | 8 -------- vendor/rails/railties/lib/webrick_server.rb | 1 + 3 files changed, 2 insertions(+), 9 deletions(-) diff --git a/app/controllers/application.rb b/app/controllers/application.rb index c328ef58..236c0df6 100644 --- a/app/controllers/application.rb +++ b/app/controllers/application.rb @@ -206,7 +206,7 @@ end module Mime # Fix HTML #HTML = Type.new "text/html", :html, %w( application/xhtml+xml ) - HTML = Type.new "text/html", :html + self.class.const_set("HTML", Type.new("text/html", :html) ) # Add XHTML XHTML = Type.new "application/xhtml+xml", :xhtml diff --git a/vendor/rails/actionpack/lib/action_controller/base.rb b/vendor/rails/actionpack/lib/action_controller/base.rb index 4c6ecd73..3c21c868 100755 --- a/vendor/rails/actionpack/lib/action_controller/base.rb +++ b/vendor/rails/actionpack/lib/action_controller/base.rb @@ -829,14 +829,6 @@ module ActionController #:nodoc: else response.body = text end - if response.headers['Status'] == "200 OK" && response.body.size > 0 - response.headers['Etag'] = "\"#{MD5.new(text).to_s}\"" - - if request.headers['HTTP_IF_NONE_MATCH'] == response.headers['Etag'] - response.headers['Status'] = "304 Not Modified" - response.body = '' - end - end response.body end diff --git a/vendor/rails/railties/lib/webrick_server.rb b/vendor/rails/railties/lib/webrick_server.rb index 5bd0b4e6..a04b664c 100644 --- a/vendor/rails/railties/lib/webrick_server.rb +++ b/vendor/rails/railties/lib/webrick_server.rb @@ -59,6 +59,7 @@ class DispatchServlet < WEBrick::HTTPServlet::AbstractServlet server.mount('/', DispatchServlet, options) trap("INT") { server.shutdown } + trap("TERM") { server.shutdown } server.start end