IRequestFilter pre-processor - either implementation or documentation is wrong
|Reported by:||Owned by:||Christian Boos|
Documentation for pre-processor in trac.web.api.IRequestFilter says …typically adding values to req.hdf…
But, looking at trac.web.main init and dispatching code, the HDF object isn't initialised when the pre-processor is called. That makes it impossible to manipulate
req.hdf - see trunk/trac/web/main.py@3602#L175
I need to set values to the HDF that is always available for my various custom templates, styles and plugins. Using the post processor works fine, except when there is any kind of error - and the req processing is halted immediately…
I made an early request for this interface in #2724, and having used it now I still think it makes sense to have 2 pre-processors - one as the current (before most init) that can influence handler choice and even allow for 'application embedding', and one that is used for setting/adjusting new and Trac generated information for all handlers before sending to processing.
However, sticking with one pre-processor, I think that the intent of the documentation is correct and most useful for now - and that the filters call should be moved down to line ±214.
Change History (21)
comment:13 follow-ups: 14 15 Changed 12 years ago by
|Status:||new → assigned|
comment:15 Changed 12 years ago by
|Status:||assigned → closed|
comment:16 Changed 12 years ago by
|Status:||closed → reopened|