зеркало из https://github.com/github/ruby.git
Match suffix for content type more precisely
Suffix needs a dot and should match the end of string.
This commit is contained in:
Родитель
bef398eb87
Коммит
3ee63cfe88
|
@ -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
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче