diff options
author | Martin Gütlein <martin.guetlein@gmail.com> | 2010-03-02 14:11:57 +0100 |
---|---|---|
committer | Martin Gütlein <martin.guetlein@gmail.com> | 2010-03-02 14:11:57 +0100 |
commit | b7efeaaf79233de8bbc173fa426e4561c458d44f (patch) | |
tree | 9326f1d711a0536f069266a4613e0e0c65e26b62 /report/report_application.rb | |
parent | e2b814301c323bc787ad9d75eceb786e3cb7dde9 (diff) |
cv statistics, ie accept header hack, alg comp report
Diffstat (limited to 'report/report_application.rb')
-rw-r--r-- | report/report_application.rb | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/report/report_application.rb b/report/report_application.rb index c68df11..4346f7f 100644 --- a/report/report_application.rb +++ b/report/report_application.rb @@ -31,9 +31,16 @@ end get '/report/:type/:id' do perform do |rs| + + accept_header = request.env['HTTP_ACCEPT'] + if request.env['HTTP_USER_AGENT'] =~ /MSIE/ + LOGGER.info "Changing MSIE accept-header to text/html" + accept_header = "text/html" + end #request.env['HTTP_ACCEPT'] = "application/pdf" - content_type Reports::ReportFormat.get_format(request.env['HTTP_ACCEPT']) - result = body(File.new( rs.get_report(params[:type],params[:id],request.env['HTTP_ACCEPT']) )) + + content_type Reports::ReportFormat.get_format(accept_header) + result = body(File.new( rs.get_report(params[:type],params[:id],accept_header) )) end end |