webmcp

diff framework/env/request/is_rerouted.lua @ 0:9fdfb27f8e67

Version 1.0.0
author jbe/bsw
date Sun Oct 25 12:00:00 2009 +0100 (2009-10-25)
parents
children
line diff
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/framework/env/request/is_rerouted.lua	Sun Oct 25 12:00:00 2009 +0100
     1.3 @@ -0,0 +1,20 @@
     1.4 +--[[--
     1.5 +
     1.6 +bool =                 -- true, if request.forard{...} or request.redirect{...} has been called before.
     1.7 +request_is_rerouted()
     1.8 +
     1.9 +This function returns true, if request.forward{...} or request.redirect{...} has been called before. In a new request caused by a redirect the function returns false. After a forward has been processed, this function also returns false.
    1.10 +
    1.11 +--]]--
    1.12 +
    1.13 +
    1.14 +function request.is_rerouted()
    1.15 +  if
    1.16 +    (request._forward and not request._forward_processed) or
    1.17 +    request._redirect
    1.18 +  then
    1.19 +    return true
    1.20 +  else
    1.21 +    return false
    1.22 +  end
    1.23 +end

Impressum / About Us