summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-05-20 13:41:10 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-05-20 13:41:10 +0000
commit83fa035d242a01f9af5a04dc6703cecc53d936a5 (patch)
tree8c501432937b5c8bcadce267e0238c1fa97fb5e7 /lib
parent57d8faeab4440e21b5a750ee346dc422a8745e89 (diff)
* lib/webrick/httpservlet/filehandler.rb (set_dir_list): share title and h1.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40859 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib')
-rw-r--r--lib/webrick/httpservlet/filehandler.rb7
1 files changed, 5 insertions, 2 deletions
diff --git a/lib/webrick/httpservlet/filehandler.rb b/lib/webrick/httpservlet/filehandler.rb
index 711ba30176..3f609adbf5 100644
--- a/lib/webrick/httpservlet/filehandler.rb
+++ b/lib/webrick/httpservlet/filehandler.rb
@@ -439,12 +439,15 @@ module WEBrick
res['content-type'] = "text/html"
+ title = "Index of #{HTMLUtils::escape(req.path)}"
res.body = <<-_end_of_html_
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
<HTML>
- <HEAD><TITLE>Index of #{HTMLUtils::escape(req.path)}</TITLE></HEAD>
+ <HEAD>
+ <TITLE>#{title}</TITLE>
+ </HEAD>
<BODY>
- <H1>Index of #{HTMLUtils::escape(req.path)}</H1>
+ <H1>#{title}</H1>
_end_of_html_
res.body << "<PRE>\n"