Ticket #3655: irequestfilter_patch_3689.diff
| File irequestfilter_patch_3689.diff, 1.9 KB (added by simon-code@…, 2 years ago) |
|---|
-
trunk/trac/web/api.py
467 467 requests, before and/or after they are processed by the main handler.""" 468 468 469 469 def pre_process_request(req, handler): 470 """ Do any pre-processing the request might need; typically adding471 values to req.hdf, or redirecting.470 """Called after initial handler selection, and can be used to change 471 the selected handler or redirect request. 472 472 473 473 Always returns the request handler, even if unchanged. 474 474 """ 475 475 476 def prepare_request(req, handler): 477 """Do any pre-processing before actual processing; typically adding 478 values to req.hdf, req.environ or similar. 479 480 If no handler is found or the handler does not use templates, 481 req.hdf will be None. 482 483 Always returns the request object, even if unchanged. 484 """ 485 476 486 def post_process_request(req, template, content_type): 477 487 """Do any post-processing the request might need; typically adding 478 488 values to req.hdf, or changing template or mime type. -
trunk/trac/web/main.py
200 200 201 201 # Prepare HDF for the clearsilver template 202 202 try: 203 req.hdf = None 203 204 use_template = getattr(chosen_handler, 'use_template', True) 204 205 if use_template: 205 206 chrome = Chrome(self.env) … … 211 212 if not early_error: 212 213 raise 213 214 215 for f in self.filters: 216 req = f.prepare_request(req, chosen_handler) 217 214 218 if early_error: 215 219 raise early_error[0], early_error[1], early_error[2] 216 220
