summaryrefslogtreecommitdiff
path: root/lib/rdoc
diff options
context:
space:
mode:
authorNobuyoshi Nakada <nobu@ruby-lang.org>2019-07-29 22:54:58 +0900
committerNobuyoshi Nakada <nobu@ruby-lang.org>2019-07-29 23:05:41 +0900
commit3ee63cfe881c9ac52a52344ea83131b88875d14c (patch)
tree5f36ece578fc6950872c708fb8b19b0783a9ff63 /lib/rdoc
parentbef398eb87ac14fffc7fe19df9ec6b07ddff17cd (diff)
Match suffix for content type more precisely
Suffix needs a dot and should match the end of string.
Diffstat (limited to 'lib/rdoc')
-rw-r--r--lib/rdoc/servlet.rb6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/rdoc/servlet.rb b/lib/rdoc/servlet.rb
index d6e8dc4672..0ff83fde77 100644
--- a/lib/rdoc/servlet.rb
+++ b/lib/rdoc/servlet.rb
@@ -102,9 +102,9 @@ class RDoc::Servlet < WEBrick::HTTPServlet::AbstractServlet
res.body = File.read asset_path
res.content_type = case req.path
- when /css$/ then 'text/css'
- when /js$/ then 'application/javascript'
- else 'application/octet-stream'
+ when /\.css\z/ then 'text/css'
+ when /\.js\z/ then 'application/javascript'
+ else 'application/octet-stream'
end
end