+ if ($res->isRedirect()) {
+ //we tried header links and that failed, now follow the redirect
+ if ($redirects > 5) {
+ return [];
+ }
+ $redirectUrl = (string) $base->resolve($res->getHeader('location'));
+ return $this->getUrls($redirectUrl, $redirects + 1);
+ }
+