changeset 5702:13fa89b5a275

fix content-type header emission (for SlideShow, for many actions calling send_title())
author Thomas Waldmann <tw AT waldmann-edv DOT de>
date Sun, 06 Jun 2010 18:06:32 +0200
parents 50d6ab432111
children 7a226e00474b
files MoinMoin/action/SlideShow.py MoinMoin/theme/__init__.py
diffstat 2 files changed, 5 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/MoinMoin/action/SlideShow.py	Sat Jun 05 18:57:04 2010 +0200
+++ b/MoinMoin/action/SlideShow.py	Sun Jun 06 18:06:32 2010 +0200
@@ -14,7 +14,7 @@
 
 import re, time
 
-from MoinMoin import wikiutil, i18n, error
+from MoinMoin import config, wikiutil, i18n, error
 from MoinMoin.Page import Page
 
 Dependencies = ['language']
@@ -158,6 +158,7 @@
         try:
             self.setSlideNumber()
             language = self.page.pi['language']
+            self.request.content_type = "text/html; charset=%s" % (config.charset, )
             self.request.setContentLanguage(language)
             self.request.write(self.template % self)
         except Error, err:
--- a/MoinMoin/theme/__init__.py	Sat Jun 05 18:57:04 2010 +0200
+++ b/MoinMoin/theme/__init__.py	Sun Jun 06 18:06:32 2010 +0200
@@ -1620,6 +1620,9 @@
         page_find_page = wikiutil.getLocalizedPage(request, 'FindPage').page_name
         home_page = wikiutil.getInterwikiHomePage(request) # sorry theme API change!!! Either None or tuple (wikiname,pagename) now.
         page_parent_page = getattr(page.getParentPage(), 'page_name', None)
+        
+        # set content_type, including charset, so web server doesn't touch it:
+        request.content_type = "text/html; charset=%s" % (config.charset, )
 
         # Prepare the HTML <head> element
         user_head = [request.cfg.html_head]