1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* lib/webrick/httpservlet/filehandler.rb (set_dir_list): set charset.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40860 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nobu 2013-05-20 13:41:16 +00:00
parent 83fa035d24
commit b6f42822fd

View file

@ -437,7 +437,13 @@ module WEBrick
list.sort!{|a,b| b[idx] <=> a[idx] }
end
res['content-type'] = "text/html"
type = "text/html"
case enc = Encoding.find('filesystem')
when Encoding::US_ASCII, Encoding::ASCII_8BIT
else
type << "; charset=\"#{enc.name}\""
end
res['content-type'] = type
title = "Index of #{HTMLUtils::escape(req.path)}"
res.body = <<-_end_of_html_