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:
parent
83fa035d24
commit
b6f42822fd
1 changed files with 7 additions and 1 deletions
|
@ -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_
|
||||
|
|
Loading…
Reference in a new issue