diff --git a/lib/cloudfront_asset_host/uploader.rb b/lib/cloudfront_asset_host/uploader.rb index cd35889..4aff32c 100644 --- a/lib/cloudfront_asset_host/uploader.rb +++ b/lib/cloudfront_asset_host/uploader.rb @@ -32,6 +32,13 @@ def upload_keys_with_paths(keys_paths, options={}) path = rewritten_css_path(path) data_path = gzip ? gzipped_path(path) : path + + headers = headers_for_path(extension, gzip) + + raise "Blank content type for #{path}, #{extension}" if + headers['Content-Type'].nil? or + headers['Content-Type'].gsub(/\s+/, '').empty? + bucket.put(key, File.read(data_path), {}, 'public-read', headers_for_path(extension, gzip)) unless dryrun File.unlink(data_path) if gzip && File.exists?(data_path)