mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
Remove IE6-7-8 file download related hack/fix
IE 6-7-8 has bug when 'Cache-Control: no-cache' head would break file download. It's been fixed in IE9 (which is also ancient and barely used version). Some extra details [here][1] and [here][2]. The way this fix is implemented clashes with what's been done in PR #40324. By adding ':public' key to cache control header set it wipes default headers. Since IE 6-7-8 are ancient browsers - let's just get rid of this hack. [1]: https://stackoverflow.com/q/9766639/843067 [2]: https://stackoverflow.com/q/3415370/843067
This commit is contained in:
parent
32488129e9
commit
d08035b0f2
3 changed files with 6 additions and 9 deletions
|
@ -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`.
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
Loading…
Reference in a new issue