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
|
-
|
old
|
new
|
|
| 262 | 262 | expose decorator. |
| 263 | 263 | """ |
| 264 | 264 | |
| | 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 | |
| 265 | 271 | # skip all the complicated stuff if we're don't have a response dict |
| 266 | 272 | # to work with. |
| 267 | 273 | if not isinstance(response, dict): |
| 268 | 274 | return response |
| 269 | 275 | |
| 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 | | |
| 276 | 276 | # Save these objeccts as locals from the SOP to avoid expensive lookups |
| 277 | 277 | req = pylons.request._current_obj() |
| 278 | 278 | tmpl_context = pylons.tmpl_context._current_obj() |
Download in other formats: