diff options
author | Nobuyoshi Nakada <[email protected]> | 2019-07-29 22:54:58 +0900 |
---|---|---|
committer | Nobuyoshi Nakada <[email protected]> | 2019-07-29 23:05:41 +0900 |
commit | 3ee63cfe881c9ac52a52344ea83131b88875d14c (patch) | |
tree | 5f36ece578fc6950872c708fb8b19b0783a9ff63 /lib/rdoc/servlet.rb | |
parent | bef398eb87ac14fffc7fe19df9ec6b07ddff17cd (diff) |
Match suffix for content type more precisely
Suffix needs a dot and should match the end of string.
Diffstat (limited to 'lib/rdoc/servlet.rb')
-rw-r--r-- | lib/rdoc/servlet.rb | 6 |
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 |