private function addPortToUri(UriInterface $uri): UriInterface
    {
        $requestPort = $this->request->getUri()->getPort();

        if (!in_array($requestPort, [80, 443])) {
            $uri = $uri->withPort($requestPort);
        }

        return $uri;
    }