Edgewall Software
Modify

Opened 8 years ago

Closed 7 years ago

Last modified 7 years ago

#12818 closed defect (fixed)

post_process_request no longer redirects after exception handling

Reported by: Ryan J Ollos Owned by: Ryan J Ollos
Priority: normal Milestone: 1.2.2
Component: web frontend Version:
Severity: normal Keywords:
Cc: Branch:
Release Notes:

The post_process_request method can redirect during exception handling from an exception raised in process_request (fix for regression in r14604).

API Changes:
Internal Changes:

Description (last modified by Ryan J Ollos)

Prior to Trac 1.2, a redirect in post_process_request during exception handling would succeed because RequestDone was re-raised.

r14604 attempted to simplify the complex nested exception handling. RequestDone is no longer re-raised.

The issue was discovered in #13185.

Attachments (0)

Change History (4)

comment:1 by Ryan J Ollos, 8 years ago

Proposed fix:

  • trac/web/main.py

    diff --git a/trac/web/main.py b/trac/web/main.py
    index d3b7fd3f8..56b493d38 100644
    a b class RequestDispatcher(Component):  
    270270            try:
    271271                self._post_process_request(req)
    272272            except RequestDone:
    273                 pass
     273                raise
    274274            except TracError as e2:
    275275                self.log.warning("Exception caught while post-processing"
    276276                                 " request: %s", exception_to_unicode(e2))

I'll look at adding a regression test that redirects in post_process_request during exception handling. Is there any other case in which RequestDone would be raised by post_process_request?

comment:2 by Ryan J Ollos, 8 years ago

Summary: post_process_request can no longer redirect in exception handlingpost_process_request no longer redirects after exception handling

comment:3 by Ryan J Ollos, 7 years ago

Release Notes: modified (diff)
Resolution: fixed
Status: assignedclosed

Committed to 1.2-stable in r15953, merged to trunk in r15954.

comment:4 by Ryan J Ollos, 7 years ago

Description: modified (diff)

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Ryan J Ollos.
The resolution will be deleted. Next status will be 'reopened'.
to The owner will be changed from Ryan J Ollos to the specified user.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.