]> git.mxchange.org Git - friendica.git/blobdiff - src/Util/HTTPSignature.php
bump version 2023.12
[friendica.git] / src / Util / HTTPSignature.php
index d48d02c20e2382cc178948280a25b865a9b45b70..9e130bc9166b00d86aaa7f0a3df1bcdaaa41e3cb 100644 (file)
@@ -420,7 +420,7 @@ class HTTPSignature
         * @return array JSON array
         * @throws \Friendica\Network\HTTPException\InternalServerErrorException
         */
-       public static function fetch(string $request, int $uid): array
+       public static function fetch(string $request, int $uid = 0): array
        {
                try {
                        $curlResult = self::fetchRaw($request, $uid);
@@ -434,6 +434,7 @@ class HTTPSignature
                }
 
                if (!$curlResult->isSuccess() || empty($curlResult->getBody())) {
+                       Logger::debug('Fetching was unsuccessful', ['url' => $request, 'return-code' => $curlResult->getReturnCode(), 'error-number' => $curlResult->getErrorNumber(), 'error' => $curlResult->getError()]);
                        return [];
                }
 
@@ -451,7 +452,7 @@ class HTTPSignature
         * @param string  $request request url
         * @param integer $uid     User id of the requester
         * @param boolean $binary  TRUE if asked to return binary results (file download) (default is "false")
-        * @param array   $opts    (optional parameters) assoziative array with:
+        * @param array   $opts    (optional parameters) associative array with:
         *                         'accept_content' => supply Accept: header with 'accept_content' as the value
         *                         'timeout' => int Timeout in seconds, default system config value or 60 seconds
         *                         'nobody' => only return the header
@@ -627,7 +628,7 @@ class HTTPSignature
                }
 
                if (empty($algorithm)) {
-                       Logger::info('No alagorithm');
+                       Logger::info('No algorithm');
                        return false;
                }