From 3df61e352dbb9aa609c22ddd4b261b3c858c985e Mon Sep 17 00:00:00 2001 From: Jacques Distler Date: Tue, 29 May 2007 17:10:20 -0500 Subject: [PATCH] Fix for IE7+MathPlayer. Based on http://lists.w3.org/Archives/Public/www-math/2007May/0044.html I've altered the Content-Type header sent to IE+MathPlayer. Rationale is explained in http://lists.w3.org/Archives/Public/www-math/2007May/0045.html --- app/controllers/application.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/controllers/application.rb b/app/controllers/application.rb index cb0bdc09..1f085d20 100644 --- a/app/controllers/application.rb +++ b/app/controllers/application.rb @@ -151,10 +151,12 @@ class ApplicationController < ActionController::Base response.headers['Content-Type'] = 'application/atom+xml; charset=UTF-8' elsif %w(tex).include?(action_name) response.headers['Content-Type'] = 'text/plain; charset=UTF-8' - elsif request.env['HTTP_USER_AGENT'] =~ /MathPlayer|Validator/ or request.env.include?('HTTP_ACCEPT') && + elsif request.env['HTTP_USER_AGENT'] =~ /Validator/ or request.env.include?('HTTP_ACCEPT') && Mime::Type.parse(request.env["HTTP_ACCEPT"]).include?(Mime::XHTML) && !(request.env['HTTP_USER_AGENT'] =~ /Safari/ and %w(s5).include?(action_name)) response.headers['Content-Type'] = 'application/xhtml+xml; charset=UTF-8' + elsif request.env['HTTP_USER_AGENT'] =~ /MathPlayer/ + response.headers['Content-Type'] = 'application/xhtml+xml' else response.headers['Content-Type'] = 'text/html; charset=UTF-8' end