[mod_python] How do you know if the current request is an internal redirect?

Gavin Panella gavin at premolo.com
Thu Aug 17 10:04:05 EDT 2006


On Thu 17 Aug 2006 15:42, Dan Eloff wrote:
> How do you know in your handler if this is an internal redirect?
> req.prev is set to a req object even if there was no internal
> redirect.

In the main request req.main is None, and in a subrequest it points back to 
the main request, so just test if it's not None.

Gavin.

-- 
Premolo Sàrl
Web: http://www.premolo.com/ ; Tel: +352 26687161 ; GSM: +352 091739359
42 rue du Kiem, L-1857 Luxembourg, Grand-Duché du Luxembourg



More information about the Mod_python mailing list