On Wed, Apr 22, 2009 at 19:24, Ben Bangert <[email protected]> wrote:
>
> It sounds like the StatusCodeRedirect isn't being used. Can you expand to
> show what else is in your middleware section. There's a toggle on full_stack
> to decide if it should put in the StatusCodeRedirect, do you have full_stack
> = true in the ini file?
>
It is. I added a print just to be sure, it prints:
<pylons.middleware.StatusCodeRedirect object at 0x9aecf2c>
But I found the problem:
app = httpexceptions.make_middleware(app, global_conf)
It turns out this line has to go after StatusCodeRedirect for it to work.
So I rearranged middleware like this:
# order of these middleware is important, they need to go
# _before_ httpexceptions middleware
if asbool(full_stack):
# Handle Python exceptions
app = ErrorHandler(app, global_conf, **config['pylons.errorware'])
app = StatusCodeRedirect(app, [401, 403, 404, 500])
# Change HTTPExceptions to HTTP responses
app = httpexceptions.make_middleware(app, global_conf)
--
Max.Ischenko // twitter.com/maxua
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"pylons-discuss" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/pylons-discuss?hl=en
-~----------~----~----~----~------~----~------~--~---