Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Woff2 Support #199

Merged
merged 1 commit into from
Aug 12, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ end
group :test do
gem 'contest'
gem 'rake'
gem 'mocha'
gem 'mocha', '0.14.0'
end

gemspec
4 changes: 2 additions & 2 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ GEM
metaclass (0.0.1)
mocha (0.14.0)
metaclass (~> 0.0.1)
rack (1.5.2)
rack (1.6.4)
rack-protection (1.5.1)
rack
rack-test (0.6.2)
Expand Down Expand Up @@ -69,7 +69,7 @@ DEPENDENCIES
gem-release
haml
less
mocha
mocha (= 0.14.0)
rake
sass
sinatra-assetpack!
Expand Down
2 changes: 1 addition & 1 deletion lib/sinatra/assetpack.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ def self.registered(app)
# Returns a list of formats that can be served.
# Anything not in this list will be rejected.
def self.supported_formats
@supported_formats ||= %w(css js png jpg gif svg otf eot ttf woff htc ico)
@supported_formats ||= %w(css js png jpg gif svg otf eot ttf woff woff2 htc ico)
end

# Returns a map of what MIME format each Tilt type returns.
Expand Down
Binary file not shown.
5 changes: 5 additions & 0 deletions test/mime_type_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -50,4 +50,9 @@ class AppTest < UnitTest
get '/fonts/cantarell-regular-webfont.woff'
assert last_response.content_type =~ %r[^application/font-woff]
end

test 'woff2' do
get '/fonts/cantarell-regular-webfont.woff2'
assert last_response.content_type =~ %r[^application/font-woff2]
end
end