// Normalize the incoming $id to make sure we have a uri
$uri = self::normalize($id);
+ common_debug(sprintf('Performing discovery for "%s" (normalized "%s")', $id, $uri));
+
foreach ($this->methods as $class) {
try {
$xrd = new XML_XRD();
$headers[] = "Accept: {$link->type}";
}
- $response = $client->get($xrd_uri, $headers);
+ $response = $client->get($xrd_uri, $headers);
if ($response->getStatus() != 200) {
throw new Exception('Unexpected HTTP status code.');
}
$xrd->loadString($response->getBody());
return $xrd;
+
+ } catch (ClientException $e) {
+ if ($e->getCode() === 403) {
+ common_log(LOG_INFO, sprintf('%s: Aborting discovery on URL %s: %s', _ve($class), _ve($uri), _ve($e->getMessage())));
+ break;
+ }
} catch (Exception $e) {
+ common_log(LOG_INFO, sprintf('%s: Failed for %s: %s', _ve($class), _ve($uri), _ve($e->getMessage())));
continue;
}
}
return $template;
}
}
-
-