Permalink
Browse files

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

  • Loading branch information...
1 parent 57c1d00 commit a7ae4d88a2a63ee1b623f822cc6432d7cbb03709 @ConradIrwin ConradIrwin committed Jul 23, 2011
Showing with 1 addition and 1 deletion.
  1. +1 −1 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
filename='profile_data'
headers['Content-Disposition'] = %(attachment; filename="#{filename}.#{filetype}")

3 comments on commit a7ae4d8

bhb replied Jul 24, 2011

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.

bhb replied Jul 24, 2011

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.