protected function redirectToUri($uri, $delay = 0, $statusCode = 303)
    {
        if ($delay === 0) {
            if (!$uri instanceof UriInterface) {
                $uri = new \Neos\Flow\Http\Uri($uri);
            }
            $this->response->setStatus($statusCode);
            $this->response->setHeader('Location', (string)$uri);
        } else {
            $escapedUri = htmlentities($uri, ENT_QUOTES, 'utf-8');
            $this->response->setStatus($statusCode);
            $this->response->setContent('<html><head><meta http-equiv="refresh" content="' . (int)$delay . ';url=' . $escapedUri . '"/></head></html>');
        }
        throw new StopActionException();
    }