There are usecases where sites have a base that's not just / or http://example.com/ but followed with a path. This is currently not supported in CountryService::getCountryByUri(). It tries to match the $path directly from the beginning but would need to detect the actual site-base and properly strip the base before detecting country/language.