protected function updateOptions(UriInterface $uri)
    {
        $query = $this->options['query'];
        if ($this->options['reuseParams']) {
            $query = array_merge(
                $query,
                $this->request->getQueryParams()
            );
        }
        $queryString = http_build_query($query);
        $uri = $uri->withQuery($queryString);
        return $this->updateHostName($uri);
    }