mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
Match suffix for content type more precisely
Suffix needs a dot and should match the end of string.
This commit is contained in:
parent
bef398eb87
commit
3ee63cfe88
1 changed files with 3 additions and 3 deletions
|
@ -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
|
||||
|
||||
|
|
Loading…
Reference in a new issue