diff options
author | drbrain <drbrain@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2011-06-16 05:37:31 +0000 |
---|---|---|
committer | drbrain <drbrain@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2011-06-16 05:37:31 +0000 |
commit | 35bb53430c634361ba84a48326a236a53a2fd680 (patch) | |
tree | 97b5b209c337ccc1b38515f1e60d4e338ae1589b | |
parent | dbf9baeddf8679c0dfeb905d720a64e657861675 (diff) |
* 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
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | lib/webrick/httpservlet/erbhandler.rb | 2 |
2 files changed, 6 insertions, 1 deletions
@@ -1,3 +1,8 @@ +Thu Jun 16 14:26:46 2011 Eric Hodel <[email protected]> + + * 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 <[email protected]> * 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 |