mirror of
https://github.com/friendica/friendica
synced 2025-04-19 10:30:10 +00:00
Introduce "accept_header" as specific argument to the http client
This commit is contained in:
parent
73c3b21665
commit
e299fc67c8
35 changed files with 150 additions and 150 deletions
|
@ -33,7 +33,6 @@ use Friendica\Core\Config\Factory\Config;
|
|||
use Friendica\Model\Register;
|
||||
use Friendica\Module\BaseAdmin;
|
||||
use Friendica\Network\HTTPClient\Client\HttpClientAccept;
|
||||
use Friendica\Network\HTTPClient\Client\HttpClientOptions;
|
||||
use Friendica\Network\HTTPException\ServiceUnavailableException;
|
||||
use Friendica\Util\DateTimeFormat;
|
||||
|
||||
|
@ -250,7 +249,7 @@ class Summary extends BaseAdmin
|
|||
private static function checkSelfHostMeta()
|
||||
{
|
||||
// Fetch the host-meta to check if this really is a vital server
|
||||
return DI::httpClient()->get(DI::baseUrl()->get() . '/.well-known/host-meta', [HttpClientOptions::ACCEPT_CONTENT => HttpClientAccept::XRD_XML])->isSuccess();
|
||||
return DI::httpClient()->get(DI::baseUrl()->get() . '/.well-known/host-meta', HttpClientAccept::XRD_XML)->isSuccess();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -61,7 +61,7 @@ class Feed extends BaseModule
|
|||
|
||||
$contact = Model\Contact::getByURLForUser($url, local_user(), null);
|
||||
|
||||
$xml = $this->httpClient->fetch($contact['poll'], 0, HttpClientAccept::FEED_XML);
|
||||
$xml = $this->httpClient->fetch($contact['poll'], HttpClientAccept::FEED_XML);
|
||||
|
||||
$import_result = Protocol\Feed::import($xml);
|
||||
|
||||
|
|
|
@ -29,7 +29,7 @@ use Friendica\Database\Database;
|
|||
use Friendica\Model\Contact;
|
||||
use Friendica\Model\User;
|
||||
use Friendica\Network\HTTPClient\Capability\ICanSendHttpRequests;
|
||||
use Friendica\Network\HTTPClient\Client\HttpClient;
|
||||
use Friendica\Network\HTTPClient\Client\HttpClientAccept;
|
||||
use Friendica\Network\HTTPClient\Client\HttpClientOptions;
|
||||
use Friendica\Util\HTTPSignature;
|
||||
use Friendica\Util\Profiler;
|
||||
|
@ -113,7 +113,7 @@ class Magic extends BaseModule
|
|||
);
|
||||
|
||||
// Try to get an authentication token from the other instance.
|
||||
$curlResult = $this->httpClient->get($basepath . '/owa', [HttpClientOptions::HEADERS => $header]);
|
||||
$curlResult = $this->httpClient->get($basepath . '/owa', HttpClientAccept::DEFAULT, [HttpClientOptions::HEADERS => $header]);
|
||||
|
||||
if ($curlResult->isSuccess()) {
|
||||
$j = json_decode($curlResult->getBody(), true);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue