Skip to content
Open
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
4 changes: 2 additions & 2 deletions lib/asset_sync/multi_mime.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ def self.lookup(ext)
ext_with_dot = ".#{ext}"
Rack::Mime.mime_type(ext_with_dot)
else
::MIME::Types.type_for(ext).first
end
nil
end || ::MIME::Types.type_for(ext).first

end

Expand Down
11 changes: 3 additions & 8 deletions lib/asset_sync/storage.rb
Original file line number Diff line number Diff line change
Expand Up @@ -134,16 +134,11 @@ def upload_file(f)
:key => f,
:body => File.open("#{path}/#{f}"),
:public => true,
:content_type => mime
:content_type => mime,
:cache_control => "public, max-age=#{one_year}",
:expires => CGI.rfc1123_date(Time.now + one_year)
}

if /-[0-9a-fA-F]{32}$/.match(File.basename(f,File.extname(f)))
file.merge!({
:cache_control => "public, max-age=#{one_year}",
:expires => CGI.rfc1123_date(Time.now + one_year)
})
end

# overwrite headers if applicable, you probably shouldn't specific key/body, but cache-control headers etc.

if files_with_custom_headers.has_key? f
Expand Down