public function dispatch(ServerRequestInterface $request) : array
    {
        $uri = $request->getUri()->getPath();
        if (! $uri || $uri[0] !== '/') {
            $uri = '/' . $uri;
        }

        return $this->createDispatcher()->dispatch(
            $request->getMethod(),
            $uri
        );
    }