code: def determine_redirect(self, url, host_header, opts):
          
          orig_host_header = host_header
          redir_url = self._determine_redirect(url, opts['verb'],
                  opts['timeout'], self._generate_headers(host_header))
  
          redirected = redir_url != url
          if redirected:
              self.out.echo('[+] Accepted redirect to %s' % redir_url)
              contains_host = orig_host_header != None
              if contains_host:
                  parsed = urlparse(redir_url)
                  dns_lookup_required = parsed.netloc != orig_host_header
                  if dns_lookup_required:
                      url = redir_url
                      host_header = None
                  else:
                      orig_parsed = urlparse(url)
                      parsed = parsed._replace(netloc=orig_parsed.netloc)
                      url = parsed.geturl()
  
              else:
                  url = redir_url
  
          return url, host_header
docs: Determines whether scanning a different request is suggested by the
          remote host. This function should be called only if
          opts['follow_redirects'] is true.
          @param url: the base url as returned by self._process_host_line.
          @param host_header: host header as returned by self._process_host_line.
          @param opts: the options as returned by self._options.
          @return: a tuple of the final url, host header. This may be the same
              objects passed in if no change is required.