Remove accept parameter for head/post again

pull/1329/head
Philipp 2022-04-03 19:33:08 +02:00 committed by Michael
parent f30413984d
commit 9bc4a5eba4
5 changed files with 6 additions and 10 deletions

View File

@ -17,7 +17,6 @@ use Friendica\DI;
use Friendica\Model\Post; use Friendica\Model\Post;
use Friendica\Model\Tag; use Friendica\Model\Tag;
use Friendica\Model\User; use Friendica\Model\User;
use Friendica\Network\HTTPClient\Client\HttpClientAccept;
use Friendica\Util\DateTimeFormat; use Friendica\Util\DateTimeFormat;
use Friendica\Util\XML; use Friendica\Util\XML;
@ -193,7 +192,7 @@ EOT;
Logger::debug('dwpost: data: ' . $xml); Logger::debug('dwpost: data: ' . $xml);
if ($dw_blog !== 'test') { if ($dw_blog !== 'test') {
$x = DI::httpClient()->post($dw_blog, $xml, HttpClientAccept::DEFAULT, ['Content-Type' => 'text/xml'])->getBody(); $x = DI::httpClient()->post($dw_blog, $xml, ['Content-Type' => 'text/xml'])->getBody();
} }
Logger::info('posted to dreamwidth: ' . ($x) ? $x : ''); Logger::info('posted to dreamwidth: ' . ($x) ? $x : '');

View File

@ -16,7 +16,6 @@ use Friendica\Core\Renderer;
use Friendica\DI; use Friendica\DI;
use Friendica\Model\Tag; use Friendica\Model\Tag;
use Friendica\Model\User; use Friendica\Model\User;
use Friendica\Network\HTTPClient\Client\HttpClientAccept;
use Friendica\Util\DateTimeFormat; use Friendica\Util\DateTimeFormat;
use Friendica\Util\XML; use Friendica\Util\XML;
@ -187,7 +186,7 @@ EOT;
Logger::debug('ijpost: data: ' . $xml); Logger::debug('ijpost: data: ' . $xml);
if ($ij_blog !== 'test') { if ($ij_blog !== 'test') {
$x = DI::httpClient()->post($ij_blog, $xml, HttpClientAccept::DEFAULT, ['Content-Type' => 'text/xml'])->getBody(); $x = DI::httpClient()->post($ij_blog, $xml, ['Content-Type' => 'text/xml'])->getBody();
} }
Logger::info('posted to insanejournal: ' . $x ? $x : ''); Logger::info('posted to insanejournal: ' . $x ? $x : '');
} }

View File

@ -17,7 +17,6 @@ use Friendica\DI;
use Friendica\Model\Post; use Friendica\Model\Post;
use Friendica\Model\Tag; use Friendica\Model\Tag;
use Friendica\Model\User; use Friendica\Model\User;
use Friendica\Network\HTTPClient\Client\HttpClientAccept;
use Friendica\Util\DateTimeFormat; use Friendica\Util\DateTimeFormat;
use Friendica\Util\XML; use Friendica\Util\XML;
@ -207,7 +206,7 @@ EOT;
Logger::debug('ljpost: data: ' . $xml); Logger::debug('ljpost: data: ' . $xml);
if ($lj_blog !== 'test') { if ($lj_blog !== 'test') {
$x = DI::httpClient()->post($lj_blog, $xml, HttpClientAccept::DEFAULT, ['Content-Type' => 'text/xml'])->getBody(); $x = DI::httpClient()->post($lj_blog, $xml, ['Content-Type' => 'text/xml'])->getBody();
} }
Logger::info('posted to livejournal: ' . ($x) ? $x : ''); Logger::info('posted to livejournal: ' . ($x) ? $x : '');
} }

View File

@ -86,7 +86,7 @@ class WebDav implements ICanWriteToStorage
*/ */
protected function exists(string $uri): bool protected function exists(string $uri): bool
{ {
return $this->client->head($uri, HttpClientAccept::DEFAULT, [HttpClientOptions::AUTH => $this->authOptions])->getReturnCode() == 200; return $this->client->head($uri, [HttpClientOptions::AUTH => $this->authOptions])->getReturnCode() == 200;
} }
/** /**
@ -178,7 +178,7 @@ class WebDav implements ICanWriteToStorage
foreach ($pathParts as $pathPart) { foreach ($pathParts as $pathPart) {
$checkUrl = $this->url . $partURL; $checkUrl = $this->url . $partURL;
if (!empty($partURL) && !$this->hasItems($checkUrl)) { if (!empty($partURL) && !$this->hasItems($checkUrl)) {
$response = $this->client->request('delete', $checkUrl, HttpClientAccept::DEFAULT, [HttpClientOptions::AUTH => $this->authOptions]); $response = $this->client->request('delete', $checkUrl, [HttpClientOptions::AUTH => $this->authOptions]);
if (!$response->isSuccess()) { if (!$response->isSuccess()) {
if ($response->getReturnCode() == "404") { if ($response->getReturnCode() == "404") {

View File

@ -5,7 +5,6 @@ namespace Friendica\Addon\webdav_storage\src;
use Friendica\Core\Config\Capability\IManageConfigValues; use Friendica\Core\Config\Capability\IManageConfigValues;
use Friendica\Core\L10n; use Friendica\Core\L10n;
use Friendica\Core\Storage\Capability\ICanConfigureStorage; use Friendica\Core\Storage\Capability\ICanConfigureStorage;
use Friendica\Network\HTTPClient\Client\HttpClientAccept;
use Friendica\Network\HTTPClient\Client\HttpClientOptions; use Friendica\Network\HTTPClient\Client\HttpClientOptions;
use Friendica\Network\HTTPClient\Capability\ICanSendHttpRequests; use Friendica\Network\HTTPClient\Capability\ICanSendHttpRequests;
@ -139,7 +138,7 @@ class WebDavConfig implements ICanConfigureStorage
]; ];
} }
if (!$this->client->head($url, HttpClientAccept::DEFAULT, [HttpClientOptions::AUTH => $options])->isSuccess()) { if (!$this->client->head($url, [HttpClientOptions::AUTH => $options])->isSuccess()) {
return [ return [
'url' => $this->l10n->t('url is either invalid or not reachable'), 'url' => $this->l10n->t('url is either invalid or not reachable'),
]; ];