Add Feedback :-)

This commit is contained in:
Philipp 2021-10-29 08:03:59 +02:00
parent 409d909d0f
commit f4ea74447e
No known key found for this signature in database
GPG key ID: 24A7501396EB5432
14 changed files with 80 additions and 44 deletions

View file

@ -26,7 +26,7 @@ use GuzzleHttp\Exception\TransferException;
/**
* Interface for calling HTTP requests and returning their responses
*/
interface ICanRequestPerHttp
interface ICanSendHttpRequests
{
/**
* Fetches the content of an URL

View file

@ -24,7 +24,7 @@ namespace Friendica\Network\HTTPClient\Client;
use Friendica\Core\System;
use Friendica\Network\HTTPClient\Response\CurlResult;
use Friendica\Network\HTTPClient\Response\GuzzleResponse;
use Friendica\Network\HTTPClient\Capability\ICanRequestPerHttp;
use Friendica\Network\HTTPClient\Capability\ICanSendHttpRequests;
use Friendica\Network\HTTPClient\Capability\ICanHandleHttpResponses;
use Friendica\Network\HTTPException\InternalServerErrorException;
use Friendica\Util\Network;
@ -42,7 +42,7 @@ use Psr\Log\LoggerInterface;
/**
* Performs HTTP requests to a given URL
*/
class HttpClientCan implements ICanRequestPerHttp
class HttpClient implements ICanSendHttpRequests
{
/** @var LoggerInterface */
private $logger;

View file

@ -6,7 +6,7 @@ use Friendica\App;
use Friendica\BaseFactory;
use Friendica\Core\Config\Capability\IManageConfigValues;
use Friendica\Network\HTTPClient\Client;
use Friendica\Network\HTTPClient\Capability\ICanRequestPerHttp;
use Friendica\Network\HTTPClient\Capability\ICanSendHttpRequests;
use Friendica\Util\Profiler;
use Friendica\Util\Strings;
use GuzzleHttp;
@ -42,9 +42,9 @@ class HttpClient extends BaseFactory
*
* @param HandlerStack|null $handlerStack (optional) A handler replacement (just usefull at test environments)
*
* @return ICanRequestPerHttp
* @return ICanSendHttpRequests
*/
public function createClient(HandlerStack $handlerStack = null): ICanRequestPerHttp
public function createClient(HandlerStack $handlerStack = null): ICanSendHttpRequests
{
$proxy = $this->config->get('system', 'proxy');
@ -108,6 +108,6 @@ class HttpClient extends BaseFactory
// Some websites test the browser for cookie support, so this enhances results.
$resolver->setCookieJar(get_temppath() .'/resolver-cookie-' . Strings::getRandomName(10));
return new Client\HttpClientCan($logger, $this->profiler, $guzzle, $resolver);
return new Client\HttpClient($logger, $this->profiler, $guzzle, $resolver);
}
}