Skip to content

Commit

Permalink
PDF download on IE needs some extra headers set
Browse files Browse the repository at this point in the history
  • Loading branch information
Jeff Wigal committed Jan 13, 2010
1 parent b17bf52 commit 178e38c
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions lib/prawnto/template_handler/compile_support.rb
Expand Up @@ -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.
Expand All @@ -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
Expand Down

0 comments on commit 178e38c

Please sign in to comment.