Added allowRedirect function. Should return true if redirect is allowed or false otherwise