Merge pull request #42609 from tadas-s/remove-ie6-7-8-specific-hack

Remove IE6-7-8 file download related hack/fix
This commit is contained in:
Guillermo Iguaran 2021-06-25 16:08:38 -07:00 committed by GitHub
commit 6f1ff6fc65
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 6 additions and 9 deletions

View File

@ -1,3 +1,9 @@
* Remove IE6-7-8 file download related hack/fix from ActionController::DataStreaming module
Not hugely relevant due to age of those IE versions and it creates somewhat unexpected Cache-Control headers.
*Tadas Sasnauskas*
* Configuration setting to skip logging an uncaught exception backtrace when the exception is
present in `rescued_responses`.

View File

@ -138,14 +138,6 @@ module ActionController #:nodoc:
end
headers["Content-Transfer-Encoding"] = "binary"
# Fix a problem with IE 6.0 on opening downloaded files:
# If Cache-Control: no-cache is set (which Rails does by default),
# IE removes the file it just downloaded from its cache immediately
# after it displays the "open/save" dialog, which means that if you
# hit "open" the file isn't there anymore when the application that
# is called for handling the download is run, so let's workaround that
response.cache_control[:public] ||= false
end
end
end

View File

@ -146,7 +146,6 @@ class SendFileTest < ActionController::TestCase
assert_equal "image/png", response.content_type
assert_equal %(disposition; filename="filename"; filename*=UTF-8''filename), response.get_header("Content-Disposition")
assert_equal "binary", response.get_header("Content-Transfer-Encoding")
assert_equal "private", response.get_header("Cache-Control")
end
end