Warning: Can't synchronize with repository "(default)" (Unsupported version control system "svn": No module named svn). Look in the Trac log for more information.

Ticket #2280: custom_content_type.patch

File custom_content_type.patch, 1019 bytes (added by ondrejj, 3 years ago)

Path to TurboGears 2.0.rc1

  • controllers.py

    old new  
    262262        expose decorator. 
    263263        """ 
    264264 
     265        content_type, engine_name, template_name, exclude_names = \ 
     266            controller.decoration.lookup_template_engine(pylons.request) 
     267 
     268        if content_type != CUSTOM_CONTENT_TYPE: 
     269            pylons.response.headers['Content-Type'] = content_type 
     270 
    265271        # skip all the complicated stuff if we're don't have a response dict 
    266272        # to work with. 
    267273        if not isinstance(response, dict): 
    268274            return response 
    269275 
    270  
    271         content_type, engine_name, template_name, exclude_names = \ 
    272             controller.decoration.lookup_template_engine(pylons.request) 
    273  
    274         pylons.response.headers['Content-Type'] = content_type 
    275  
    276276        # Save these objeccts as locals from the SOP to avoid expensive lookups 
    277277        req = pylons.request._current_obj() 
    278278        tmpl_context = pylons.tmpl_context._current_obj()