Skip to content

Commit

Permalink
Merge pull request #42609 from tadas-s/remove-ie6-7-8-specific-hack
Browse files Browse the repository at this point in the history
Remove IE6-7-8 file download related hack/fix
  • Loading branch information
guilleiguaran committed Jun 25, 2021
2 parents 1aa9115 + d08035b commit 6f1ff6f
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 9 deletions.
6 changes: 6 additions & 0 deletions actionpack/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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`.

Expand Down
8 changes: 0 additions & 8 deletions actionpack/lib/action_controller/metal/data_streaming.rb
Original file line number Diff line number Diff line change
Expand Up @@ -138,14 +138,6 @@ def send_file_headers!(options)
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
1 change: 0 additions & 1 deletion actionpack/test/controller/send_file_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,6 @@ def test_send_file_headers_bang
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

Expand Down

0 comments on commit 6f1ff6f

Please sign in to comment.