summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog5
-rw-r--r--lib/webrick/httpservlet/erbhandler.rb2
2 files changed, 6 insertions, 1 deletions
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 <[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