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.
This commit is contained in:
Jacques Distler 2007-10-01 22:09:51 -05:00
parent 3b6523b4f4
commit b0e316e37c
3 changed files with 2 additions and 9 deletions

View file

@ -206,7 +206,7 @@ end
module Mime module Mime
# Fix HTML # Fix HTML
#HTML = Type.new "text/html", :html, %w( application/xhtml+xml ) #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 # Add XHTML
XHTML = Type.new "application/xhtml+xml", :xhtml XHTML = Type.new "application/xhtml+xml", :xhtml

View file

@ -829,14 +829,6 @@ module ActionController #:nodoc:
else else
response.body = text response.body = text
end 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 response.body
end end

View file

@ -59,6 +59,7 @@ class DispatchServlet < WEBrick::HTTPServlet::AbstractServlet
server.mount('/', DispatchServlet, options) server.mount('/', DispatchServlet, options)
trap("INT") { server.shutdown } trap("INT") { server.shutdown }
trap("TERM") { server.shutdown }
server.start server.start
end end