original_string: public function redirect($url)
      {
          // has redirect from upstream
          if (($this->status === 301 || $this->status === 302) && ($this->hasHeader('location'))) {
              return;
          }
          // @fixme need a better solution
          $this->numRedirected--;
          $this->status = 302;
          $this->setHeader('location', $url);
      }
code: public function redirect($url)
      {
          // has redirect from upstream
          if (($this->status === 301 || $this->status === 302) && ($this->hasHeader('location'))) {
              return;
          }
          // @fixme need a better solution
          $this->numRedirected--;
          $this->status = 302;
          $this->setHeader('location', $url);
      }
code_tokens: public function redirect ( $ url ) { // has redirect from upstream if ( ( $ this -> status === 301 || $ this -> status === 302 ) && ( $ this -> hasHeader ( 'location' ) ) ) { return ; } // @fixme need a better solution $ this -> numRedirected -- ; $ this -> status = 302 ; $ this -> setHeader ( 'location' , $ url ) ; }
docstring: Redirect to another url
  This method can be used in request callback.
  @param string $url target url to be redirected to.
docstring_tokens: Redirect to another url This method can be used in request callback .