Return the value of the redirect response
184602
def value(self):
        
        user = self.trigger.agentml.request_log.most_recent().user
        groups = self.trigger.agentml.request_log.most_recent().groups

        # Does the redirect statement have tags to parse?
        if len(self._element):
            message = ''.join(map(str, self.trigger.agentml.parse_tags(self._element, self.trigger)))
        else:
            message = self._element.text

        # Is there a default value defined?
        default = attribute(self._element, 'default', '')
        response = self.trigger.agentml.get_reply(user.id, message, groups)

        return response or default
542956
def get_header_url(response, header_name):
    
    url = response.headers.get(header_name)
    try:
        _validate(url)
    except ValueError:
        return None
    else:
        return url
799737
def get_safe_redirect_target(arg='next'):
    
    for target in request.args.get(arg), request.referrer:
        if target:
            redirect_uri = urisplit(target)
            allowed_hosts = current_app.config.get('APP_ALLOWED_HOSTS', [])
            if redirect_uri.host in allowed_hosts:
                return target
            elif redirect_uri.path:
                return uricompose(
                    path=redirect_uri.path,
                    query=redirect_uri.query,
                    fragment=redirect_uri.fragment
                )
    return None
519189
function redirect() {
                var resultURL = urlTransform(req.url, function(parsed) {
                    parsed.pathname += '/';
                    return parsed;
                });

                res.statusCode = 301;
                res.setHeader('Location', resultURL);
                res.end('Redirecting to ' + resultURL);
            }
938236
def return_response(self, value=None):
        # type: (Any) -> Tuple[Callback, Return]
        """"""
        response = Return(id=self.id, value=value)
        return self.callback, response
869870
def get_redirect_url(request):
    

    next_ = request.GET.get(REDIRECT_FIELD_NAME)
    if not next_:
        redirect_url = resolve_url(django_settings.CAS_REDIRECT_URL)
        if django_settings.CAS_IGNORE_REFERER:
            next_ = redirect_url
        else:
            next_ = request.META.get('HTTP_REFERER', redirect_url)
        prefix = urllib_parse.urlunparse(
            (get_protocol(request), request.get_host(), '', '', '', ''),
        )
        if next_.startswith(prefix):
            next_ = next_[len(prefix):]
    return next_
178836
def handle_response(response)
      case response.code.to_i
        when 301,302
          raise "Redirect"
        when 200...400
          response
        when 400
          raise "Bad Request"
        when 401
          raise "Unauthorized Access"
        when 403
          raise "Forbidden Access"
        when 404
          raise "Rescoure not found"
        when 405
          raise "Method not allowed"
        when 409
          raise RequestError.new("Rescource conflict")
        when 422
          raise RequestError.new("Resource invalid")
        when 401...500
          raise "Client error"
        when 500...600
          raise RequestError.new("Server error")
        else
          raise "Unknown response: #{response.code.to_i}"
      end
    end
676057
def _get_redirect_url(self, request):
        
        if 'next' in request.session:
            next_url = request.session['next']
            del request.session['next']
        elif 'next' in request.GET:
            next_url = request.GET.get('next')
        elif 'next' in request.POST:
            next_url = request.POST.get('next')
        else:
            next_url = request.user.get_absolute_url()
        if not next_url:
            next_url = '/'
        return next_url
42423
def get_redirect_url(self, **kwargs):
        
        params = {
            'oauth_token': self.get_request_token().key,
        }
        return '%s?%s' % (self.auth_url, urllib.urlencode(params))
1009320
public function getRedirectData()
    {
        if ($this->isRedirect()) {
            return array(
                'PaReq' => $this->getDataItem('PAReq'),
                'TermUrl' => $this->getRequest()->getReturnUrl(),
                'MD' => $this->getDataItem('MD'),
            );
        }
    }
458586
def redirect(self, redirect_url=None, message=None, level="info"):
        
        if redirect_url is None:
            redirect_url = self.back_url
        if message is not None:
            self.add_status_message(message, level)
        return self.request.response.redirect(redirect_url)
1017249
def get_redirect_args(self, request, callback):
        """"""
        callback = force_text(request.build_absolute_uri(callback))
        raw_token = self.get_request_token(request, callback)
        token, secret, _ = self.parse_raw_token(raw_token)
        if token is not None and secret is not None:
            request.session[self.session_key] = raw_token
        args = {
            'oauth_token': token,
            'oauth_callback': callback,
        }

        scope = self.get_scope(request)
        if scope:
            args['scope'] = self.scope_separator.join(self.get_scope(request))

        return args
363772
def get_redirect_url(self, request, callback, parameters=None):
        """"""
        args = self.get_redirect_args(request, callback=callback)
        additional = parameters or {}
        args.update(additional)
        params = urlencode(args)
        return '{0}?{1}'.format(self.authorization_url, params)
1088288
public function getRedirect()
    {
        if (!$this->isRedirect())
            return null;

        if ($this->isPermanentRedirect())
            return substr($this->name, 19);

        return substr($this->name, 9);
    }
357532
def _parse_redirect(self, element):
        
        self._log.info('Parsing new redirected Response')
        self._responses.add(Response(self, element, self.file_path))
64818
def is_redirect(self):
        ''''''
        if self._response:
            status_code = self._response.status_code
            return status_code in self._codes \
                or status_code in self._repeat_codes
431450
def get(self, request, *args, **kwargs):
        
        if not request.GET.get('cp'):
            return HttpResponse(_('missing cp GET param'), status=400)
        self.authorize(request, *args, **kwargs)
        return HttpResponseRedirect(self.get_redirect_url(request))