Permalink
Browse files

PDF download on IE needs some extra headers set

  • Loading branch information...
1 parent b17bf52 commit 178e38ca6e4c684dc53325fcd98621d175159ba2 Jeff Wigal committed Jan 13, 2010
Showing with 8 additions and 0 deletions.
  1. +8 −0 lib/prawnto/template_handler/compile_support.rb
@@ -21,6 +21,7 @@ def set_headers
set_cache_control
set_content_type
set_disposition
+ set_other_headers_for_ie_ssl
end
# TODO: kept around from railspdf-- maybe not needed anymore? should check.
@@ -34,6 +35,13 @@ def ssl_request?
@controller.request.env['SERVER_PROTOCOL'].downcase == "https"
end
memoize :ssl_request?
+
+ def set_other_headers_for_ie_ssl
+ return unless ssl_request? && ie_request?
+ @controller.headers['Content-Description'] = 'File Transfer'
+ @controller.headers['Content-Transfer-Encoding'] = 'binary'
+ @controller.headers['Expires'] = '0'
+ end
# TODO: kept around from railspdf-- maybe not needed anymore? should check.
def set_pragma

0 comments on commit 178e38c

Please sign in to comment.