LRDD blacklisted URL test
This commit is contained in:
parent
e1df763940
commit
985f3b44b7
|
@ -126,7 +126,14 @@ class Discovery
|
||||||
|
|
||||||
$xrd->loadString($response->getBody());
|
$xrd->loadString($response->getBody());
|
||||||
return $xrd;
|
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) {
|
} catch (Exception $e) {
|
||||||
|
common_log(LOG_INFO, sprintf('%s: Failed for %s: %s', _ve($class), _ve($uri), _ve($e->getMessage())));
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -32,6 +32,9 @@ abstract class LRDDMethod
|
||||||
|
|
||||||
protected function fetchUrl($url, $method=HTTPClient::METHOD_GET)
|
protected function fetchUrl($url, $method=HTTPClient::METHOD_GET)
|
||||||
{
|
{
|
||||||
|
// If we have a blacklist enabled, let's check against it
|
||||||
|
Event::handle('UrlBlacklistTest', array($url));
|
||||||
|
|
||||||
$client = new HTTPClient();
|
$client = new HTTPClient();
|
||||||
|
|
||||||
// GAAHHH, this method sucks! How about we make a better HTTPClient interface?
|
// GAAHHH, this method sucks! How about we make a better HTTPClient interface?
|
||||||
|
|
Loading…
Reference in New Issue
Block a user