Skip to content


Subversion checkout URL

You can clone with
Download ZIP
Browse files

Don't set content-disposition on pdfs. (browsers can cope...)

  • Loading branch information...
commit a7ae4d88a2a63ee1b623f822cc6432d7cbb03709 1 parent 57c1d00
@ConradIrwin ConradIrwin authored
Showing with 1 addition and 1 deletion.
  1. +1 −1  lib/rack/perftools_profiler/profiler_middleware.rb
2  lib/rack/perftools_profiler/profiler_middleware.rb
@@ -59,7 +59,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
headers['Content-Disposition'] = %(attachment; filename="#{filename}.#{filetype}")

3 comments on commit a7ae4d8


Thanks for all the patches. What's the rationale for removing the content-disposition for PDFs? Was it causing a problem for your app?


I use Chrome as my PDF reader — it's annoying to have to download it and then re-open it. If the browser didn't support viewing PDFs then it would still get downloaded (albeit under a less nice filename), so this is definitely a net win for me (not sure about other people though).

If you want me to re-arrange patches so that this is out of the history of other stuff, I can do that.


Ah, I see. Yeah, that is annoying. OK, I'll include this patch - don't worry about re-arranging them.

Please sign in to comment.
Something went wrong with that request. Please try again.