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);
    }