getUri(); $path = $uri->getPath(); // If the path does not begin with the version number, prepend v1 by default for BC compatibility purposes if (strpos($path, '/v') !== 0) { $request = $request->withUri($uri->withPath('/v1' . $uri->getPath())); } return $handler->handle($request); } }