Skip to content

Commit

Permalink
Merge pull request rack#791 from tagliala/add-woff2-mime-type
Browse files Browse the repository at this point in the history
Add woff2 mime type
  • Loading branch information
spastorino committed Feb 2, 2015
2 parents 15bbd0c + 1cb417b commit 7c574e2
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
1 change: 1 addition & 0 deletions lib/rack/mime.rb
Original file line number Diff line number Diff line change
Expand Up @@ -614,6 +614,7 @@ def match?(value, matcher)
".wmx" => "video/x-ms-wmx",
".wmz" => "application/x-ms-wmz",
".woff" => "application/font-woff",
".woff2" => "application/font-woff2",
".wpd" => "application/vnd.wordperfect",
".wpl" => "application/vnd.ms-wpl",
".wps" => "application/vnd.ms-works",
Expand Down
6 changes: 3 additions & 3 deletions lib/rack/static.rb
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,8 @@ module Rack
# 4) Regular Expressions / Regexp
# Provide a regular expression
# %r{\.(?:css|js)\z} => Matches files ending in .css or .js
# /\.(?:eot|ttf|otf|woff|svg)\z/ => Matches files ending in
# the most common web font formats (.eot, .ttf, .otf, .woff, .svg)
# /\.(?:eot|ttf|otf|woff2|woff|svg)\z/ => Matches files ending in
# the most common web font formats (.eot, .ttf, .otf, .woff2, .woff, .svg)
# Note: This Regexp is available as a shortcut, using the :fonts rule
#
# 5) Font Shortcut
Expand Down Expand Up @@ -132,7 +132,7 @@ def applicable_rules(path)
when :all
true
when :fonts
path =~ /\.(?:ttf|otf|eot|woff|svg)\z/
path =~ /\.(?:ttf|otf|eot|woff2|woff|svg)\z/
when String
path = ::Rack::Utils.unescape(path)
path.start_with?(rule) || path.start_with?('/' + rule)
Expand Down

0 comments on commit 7c574e2

Please sign in to comment.