location(s)


  
      function follow_location()
      {
          if (preg_match("#(location|uri):([^\r\n]*)#i", this->response_headers, matches))
          {
              uri = this->decode_url(trim(matches[2]));
  
              if (!preg_match('#^[\w+.-]+://#i', uri))
              {
                  if (substr(uri, 0, 1) == '/')
                  {
                      uri = this->url_segments['scheme'] . '://' . this->url_segments['host'] . uri;
                  }
                  else
                  {
                      uri = this->url_segments['prefix'] . '/' . uri;
                  }
              }
  
              this->url = uri;
              return true;
          }
          return false;
      }