public function process(ServerRequestInterface $request, RequestHandlerInterface $next) : ResponseInterface
    {
        $path = $request->getUri()->getPath();
        if (!empty($this->basePath) && 0 === strpos($path, $this->basePath)) {
            $cleanPath = substr($path, strlen($this->basePath));

            if ($cleanPath === false) {
                $cleanPath = '';
            }

            $request = $request->withUri($request->getUri()->withPath($cleanPath));
        }
        return $next->handle($request);
    }