aboutsummaryrefslogtreecommitdiffstats
path: root/activestorage/lib/active_storage/engine.rb
diff options
context:
space:
mode:
authorGeorge Claghorn <george.claghorn@gmail.com>2018-01-05 11:55:40 -0500
committerGitHub <noreply@github.com>2018-01-05 11:55:40 -0500
commit1e51a38fbc767f2c7e33c0ac548422eebbb5981d (patch)
treeac9cada273b492f231bf1b48d215e36ff78fde05 /activestorage/lib/active_storage/engine.rb
parent5a5014688873f1d6e1b66075eea8a4356b5a4d07 (diff)
parentd40284b1a44773b03d78ca67a888b94fd330d1b1 (diff)
downloadrails-1e51a38fbc767f2c7e33c0ac548422eebbb5981d.tar.gz
rails-1e51a38fbc767f2c7e33c0ac548422eebbb5981d.tar.bz2
rails-1e51a38fbc767f2c7e33c0ac548422eebbb5981d.zip
Merge pull request #31639 from rosa/master
Force :attachment as content disposition for some content types
Diffstat (limited to 'activestorage/lib/active_storage/engine.rb')
-rw-r--r--activestorage/lib/active_storage/engine.rb11
1 files changed, 11 insertions, 0 deletions
diff --git a/activestorage/lib/active_storage/engine.rb b/activestorage/lib/active_storage/engine.rb
index d5c71670ff..1f15ac2d2d 100644
--- a/activestorage/lib/active_storage/engine.rb
+++ b/activestorage/lib/active_storage/engine.rb
@@ -18,6 +18,16 @@ module ActiveStorage
config.active_storage.analyzers = [ ActiveStorage::Analyzer::ImageAnalyzer, ActiveStorage::Analyzer::VideoAnalyzer ]
config.active_storage.paths = ActiveSupport::OrderedOptions.new
config.active_storage.variable_content_types = [ "image/png", "image/gif", "image/jpg", "image/jpeg", "image/vnd.adobe.photoshop" ]
+ config.active_storage.content_types_to_serve_as_binary = [
+ "text/html",
+ "text/javascript",
+ "image/svg+xml",
+ "application/postscript",
+ "application/x-shockwave-flash",
+ "text/xml",
+ "application/xml",
+ "application/xhtml+xml"
+ ]
config.eager_load_namespaces << ActiveStorage
@@ -29,6 +39,7 @@ module ActiveStorage
ActiveStorage.analyzers = app.config.active_storage.analyzers || []
ActiveStorage.paths = app.config.active_storage.paths || {}
ActiveStorage.variable_content_types = app.config.active_storage.variable_content_types || []
+ ActiveStorage.content_types_to_serve_as_binary = app.config.active_storage.content_types_to_serve_as_binary || []
end
end