Browse files

Don't set content-disposition for pdf

  • Loading branch information...
1 parent 792fcb5 commit fce1b0c2e0787c2171dfbbb71b4809baeeebe4dc @bhb committed Jul 25, 2011
Showing with 4 additions and 4 deletions.
  1. +1 −1 lib/rack/perftools_profiler/profiler_middleware.rb
  2. +3 −3 test/single_request_profiling_test.rb
View
2 lib/rack/perftools_profiler/profiler_middleware.rb
@@ -61,7 +61,7 @@ def headers(printer, body)
'Content-Type' => PRINTER_CONTENT_TYPE[printer],
'Content-Length' => content_length(body)
}
- if printer==:pdf || printer ==:raw
+ if printer ==:raw
filetype = printer
filename='profile_data'
headers['Content-Disposition'] = %(attachment; filename="#{filename}.#{filetype}")
View
6 test/single_request_profiling_test.rb
@@ -258,11 +258,11 @@ def setup
end
- context 'when using the pdf printer' do
+ context 'when using the raw printer' do
should 'have default filename' do
- _, headers, _ = Rack::PerftoolsProfiler.new(@app, :default_printer => 'pdf').call(@profiled_request_env)
- assert_equal %q{attachment; filename="profile_data.pdf"}, headers['Content-Disposition']
+ _, headers, _ = Rack::PerftoolsProfiler.new(@app, :default_printer => 'raw').call(@profiled_request_env)
+ assert_equal %q{attachment; filename="profile_data.raw"}, headers['Content-Disposition']
end
end

0 comments on commit fce1b0c

Please sign in to comment.