]> git.mxchange.org Git - friendica-addons.git/commitdiff
Remove accept parameter for head/post again
authorPhilipp <admin@philipp.info>
Sun, 3 Apr 2022 17:33:08 +0000 (19:33 +0200)
committerPhilipp <admin@philipp.info>
Sun, 3 Apr 2022 17:33:08 +0000 (19:33 +0200)
dwpost/dwpost.php
ijpost/ijpost.php
ljpost/ljpost.php
webdav_storage/src/WebDav.php
webdav_storage/src/WebDavConfig.php

index bab93dff94e601411005c20c58add4d9b1f4b984..286d8012745f58cf9e8576a66f38bbe0dade3196 100644 (file)
@@ -17,7 +17,6 @@ use Friendica\DI;
 use Friendica\Model\Post;
 use Friendica\Model\Tag;
 use Friendica\Model\User;
-use Friendica\Network\HTTPClient\Client\HttpClientAccept;
 use Friendica\Util\DateTimeFormat;
 use Friendica\Util\XML;
 
@@ -193,7 +192,7 @@ EOT;
                Logger::debug('dwpost: data: ' . $xml);
 
                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 : '');
index 832dff2c709e9fad4591bd43ae454e1e7322b9da..79cd75c89375a1d89842fa9c77464c7dc0f6a472 100644 (file)
@@ -16,7 +16,6 @@ use Friendica\Core\Renderer;
 use Friendica\DI;
 use Friendica\Model\Tag;
 use Friendica\Model\User;
-use Friendica\Network\HTTPClient\Client\HttpClientAccept;
 use Friendica\Util\DateTimeFormat;
 use Friendica\Util\XML;
 
@@ -187,7 +186,7 @@ EOT;
                Logger::debug('ijpost: data: ' . $xml);
 
                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 : '');
        }
index 2fa5e782b043319d7b3a0583c926e25bdfe42f3a..073a977e8b3e0952144531d912a2e0beba340c48 100644 (file)
@@ -17,7 +17,6 @@ use Friendica\DI;
 use Friendica\Model\Post;
 use Friendica\Model\Tag;
 use Friendica\Model\User;
-use Friendica\Network\HTTPClient\Client\HttpClientAccept;
 use Friendica\Util\DateTimeFormat;
 use Friendica\Util\XML;
 
@@ -207,7 +206,7 @@ EOT;
                Logger::debug('ljpost: data: ' . $xml);
 
                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 : '');
        }
index 2e6b5b4e5bb5b22a5de12dba205a49c6f745f6cf..1a31a4c25d364a71c0f96b35b5d7189f131239ea 100644 (file)
@@ -86,7 +86,7 @@ class WebDav implements ICanWriteToStorage
         */
        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) {
                        $checkUrl = $this->url . $partURL;
                        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->getReturnCode() == "404") {
index 4a0c3c6790c91cfe72ad2c5401f2c13cc9d620ae..2236e97ab36de191419d2f2ad694ee0a261f58a1 100644 (file)
@@ -5,7 +5,6 @@ namespace Friendica\Addon\webdav_storage\src;
 use Friendica\Core\Config\Capability\IManageConfigValues;
 use Friendica\Core\L10n;
 use Friendica\Core\Storage\Capability\ICanConfigureStorage;
-use Friendica\Network\HTTPClient\Client\HttpClientAccept;
 use Friendica\Network\HTTPClient\Client\HttpClientOptions;
 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 [
                                'url' => $this->l10n->t('url is either invalid or not reachable'),
                        ];