web/request.py
changeset 2558 81c8b5312f9c
parent 2556 4608d259c3db
child 2559 46859078c866
--- a/web/request.py	Tue Jul 28 22:22:08 2009 +0200
+++ b/web/request.py	Wed Jul 29 10:43:30 2009 +0200
@@ -699,6 +699,14 @@
         return useragent and 'MSIE' in useragent
 
     def xhtml_browser(self):
+        """return True if the browser is considered as xhtml compatible.
+
+        If the instance is configured to always return text/html and not
+        application/xhtml+xml, this method will always return False, even though
+        this is semantically different
+        """
+        if self.vreg.config['force-html-content-type']:
+            return False
         useragent = self.useragent()
         # * MSIE/Konqueror does not support xml content-type
         # * Opera supports xhtml and handles namespaces properly but it breaks
@@ -709,7 +717,7 @@
         return True
 
     def html_content_type(self):
-        if not self.vreg.config['force-html-content-type'] and self.xhtml_browser():
+        if self.xhtml_browser():
             return 'application/xhtml+xml'
         return 'text/html'