diff --git a/src/ExtractorFactory.php b/src/ExtractorFactory.php index 55624f6c..9ba37e0b 100644 --- a/src/ExtractorFactory.php +++ b/src/ExtractorFactory.php @@ -46,7 +46,14 @@ public function createExtractor(UriInterface $uri, RequestInterface $request, Re $class = $this->default; foreach ($this->adapters as $adapterHost => $adapter) { - if (substr($host, -strlen($adapterHost)) === $adapterHost) { + // Check if $host is the same domain as $adapterHost. + if ($host === $adapterHost) { + $class = $adapter; + break; + } + + // Check if $host is a subdomain of $adapterHost. + if (substr($host, -strlen($adapterHost) + 1) === ".{$adapterHost}") { $class = $adapter; break; }