From 35bb53430c634361ba84a48326a236a53a2fd680 Mon Sep 17 00:00:00 2001 From: drbrain Date: Thu, 16 Jun 2011 05:37:31 +0000 Subject: * lib/webrick/httpservlet/erbhandler.rb: Allow the ERB document to alter the content-type of the response. [Ruby 1.9 - Bug #4685] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32117 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ChangeLog | 5 +++++ lib/webrick/httpservlet/erbhandler.rb | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 753b619c8c..4859859e60 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +Thu Jun 16 14:26:46 2011 Eric Hodel + + * 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 * lib/timeout.rb: Clarify timeout duration types. Patch by Alf Mikula. diff --git a/lib/webrick/httpservlet/erbhandler.rb b/lib/webrick/httpservlet/erbhandler.rb index 621d5206c0..34b4b9e68b 100644 --- a/lib/webrick/httpservlet/erbhandler.rb +++ b/lib/webrick/httpservlet/erbhandler.rb @@ -54,7 +54,7 @@ module WEBrick 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 -- cgit v1.2.3