Skip to content
This repository has been archived by the owner on Dec 5, 2023. It is now read-only.

Commit

Permalink
Merge branch 'wip.allow-raw'
Browse files Browse the repository at this point in the history
  • Loading branch information
ConradIrwin committed Jul 23, 2011
2 parents 9c0cd11 + a7ae4d8 commit 5611cbc
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions lib/rack/perftools_profiler/profiler_middleware.rb
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ class ProfilerMiddleware
:text => 'text/plain', :text => 'text/plain',
:gif => 'image/gif', :gif => 'image/gif',
:pdf => 'application/pdf', :pdf => 'application/pdf',
:callgrind => 'text/plain' :callgrind => 'text/plain',
:raw => 'application/octet-stream'
} }


PRINTERS = PRINTER_CONTENT_TYPE.keys PRINTERS = PRINTER_CONTENT_TYPE.keys
Expand Down Expand Up @@ -58,7 +59,7 @@ def headers(printer, body)
'Content-Type' => PRINTER_CONTENT_TYPE[printer], 'Content-Type' => PRINTER_CONTENT_TYPE[printer],
'Content-Length' => content_length(body) 'Content-Length' => content_length(body)
} }
if printer==:pdf if printer ==:raw
filetype = printer filetype = printer
filename='profile_data' filename='profile_data'
headers['Content-Disposition'] = %(attachment; filename="#{filename}.#{filetype}") headers['Content-Disposition'] = %(attachment; filename="#{filename}.#{filetype}")
Expand Down

0 comments on commit 5611cbc

Please sign in to comment.