ruby-changes:20070
From: drbrain <ko1@a...>
Date: Thu, 16 Jun 2011 14:37:48 +0900 (JST)
Subject: [ruby-changes:20070] drbrain:r32117 (trunk): * lib/webrick/httpservlet/erbhandler.rb: Allow the ERB document to
drbrain 2011-06-16 14:37:31 +0900 (Thu, 16 Jun 2011) New Revision: 32117 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=32117 Log: * lib/webrick/httpservlet/erbhandler.rb: Allow the ERB document to alter the content-type of the response. [Ruby 1.9 - Bug #4685] Modified files: trunk/ChangeLog trunk/lib/webrick/httpservlet/erbhandler.rb Index: ChangeLog =================================================================== --- ChangeLog (revision 32116) +++ ChangeLog (revision 32117) @@ -1,3 +1,8 @@ +Thu Jun 16 14:26:46 2011 Eric Hodel <drbrain@s...> + + * lib/webrick/httpservlet/erbhandler.rb: Allow the ERB document to + alter the content-type of the response. [Ruby 1.9 - Bug #4685] + Thu Jun 16 14:15:47 2011 Eric Hodel <drbrain@s...> * lib/timeout.rb: Clarify timeout duration types. Patch by Alf Mikula. Index: lib/webrick/httpservlet/erbhandler.rb =================================================================== --- lib/webrick/httpservlet/erbhandler.rb (revision 32116) +++ lib/webrick/httpservlet/erbhandler.rb (revision 32117) @@ -54,7 +54,7 @@ begin data = open(@script_filename){|io| io.read } res.body = evaluate(ERB.new(data), req, res) - res['content-type'] = + res['content-type'] ||= HTTPUtils::mime_type(@script_filename, @config[:MimeTypes]) rescue StandardError => ex raise -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/