private function mergeBasePath()
    {
        if (null !== $this->baseUri->authority && '' === $this->baseUri->path) {
            $this->path = '/' . $this->path;
        } else {
            if (false !== $lastSlashPos = strrpos($this->baseUri->path, '/')) {
                $basePath = substr($this->baseUri->path, 0, $lastSlashPos + 1);
                $this->path = $basePath . $this->path;
            }
        }
    }