Skip to content

Commit

Permalink
have s3Uploader upload svgs with correct content-type
Browse files Browse the repository at this point in the history
fixes: CNVS-22212

test plan:
* delete stuff on your s3 bucket
* compile assets and upload to s3
* go to the files section, the icons for folders 
  and documents and stuff (the svgs) should show 
  up correctly

Change-Id: Ic3bf717ffa1b8e2d42b7b0e0d569dacbab90d41d
Reviewed-on: https://gerrit.instructure.com/59470
Tested-by: Jenkins
Reviewed-by: Jacob Fugal <[email protected]>
QA-Review: Jeremy Putnam <[email protected]>
Product-Review: Ryan Shaw <[email protected]>
  • Loading branch information
ryankshaw committed Jul 29, 2015
1 parent 91e75e4 commit b89a3ee
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/canvas/cdn/s3_uploader.rb
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,9 @@ def font?(path)
end

def mime_for(path)
Mime::Type.lookup_by_extension(path.extname[1..-1])
ext = path.extname[1..-1]
# Mime::Type.lookup_by_extension doesn't have some types (like svg), so fall back to others
Mime::Type.lookup_by_extension(ext) || Rack::Mime.mime_type(".#{ext}") || MIME::Types.type_for(ext).first
end

def options_for(path)
Expand Down

0 comments on commit b89a3ee

Please sign in to comment.